Skip to content

Commit 895ee6e

Browse files
committed
fixup! [llvm][clang] duplicate long double layout logic from clang to LLVM
1 parent bb0c234 commit 895ee6e

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1283,7 +1283,7 @@ class Triple {
12831283

12841284
/// Return true if `long double` and `_Float128` have the same layout.
12851285
bool isLongDoubleF128(const StringRef &ABIName) const {
1286-
return getCLayouts(ABIName).LongDoubleWidth == 128;
1286+
return getCLayouts(ABIName).LongDoubleFormat == &APFloatBase::IEEEquad();
12871287
}
12881288
};
12891289

llvm/lib/TargetParser/Triple.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2165,12 +2165,12 @@ VersionTuple Triple::getCanonicalVersionForOS(OSType OSKind,
21652165
}
21662166

21672167
Triple::CLayouts Triple::getCLayouts(const StringRef &ABIName) const {
2168-
Triple::CLayouts Layouts;
2169-
21702168
// Default to a 32-bit RISC platform
2171-
Layouts.LongDoubleWidth = 64;
2172-
Layouts.LongDoubleAlign = 64;
2173-
Layouts.LongDoubleFormat = &llvm::APFloat::IEEEdouble();
2169+
Triple::CLayouts Layouts {
2170+
.LongDoubleWidth = 64,
2171+
.LongDoubleAlign = 64,
2172+
.LongDoubleFormat = &llvm::APFloat::IEEEdouble(),
2173+
};
21742174

21752175
enum ArchType Arch = getArch();
21762176

0 commit comments

Comments
 (0)