Skip to content

Commit 8add5ca

Browse files
committed
Temporary work
1 parent 714cfe0 commit 8add5ca

File tree

4 files changed

+10
-8
lines changed

4 files changed

+10
-8
lines changed

clang/lib/Basic/TargetInfo.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -960,17 +960,17 @@ bool TargetInfo::validatePointerAuthKey(const llvm::APSInt &value) const {
960960
}
961961

962962
void TargetInfo::validateCLayouts() const {
963-
llvm::Triple::CLayouts TripleLayouts = Triple.getCLayouts();
963+
llvm::Triple::CLayouts TripleLayouts = Triple.getCLayouts(getABI());
964964
if (__builtin_expect(LongDoubleWidth != TripleLayouts.LongDoubleWidth ||
965965
LongDoubleAlign != TripleLayouts.LongDoubleAlign ||
966966
LongDoubleFormat != TripleLayouts.LongDoubleFormat,
967967
0)) {
968-
fprintf(stderr, "'long double' width got %d, expected %d\n",
968+
fprintf(stderr, "Clang's 'long double' width is %d, LLVM expected %d\n",
969969
LongDoubleWidth, TripleLayouts.LongDoubleWidth);
970-
fprintf(stderr, "'long double' align got %d, expected %d\n",
970+
fprintf(stderr, "Clang's long double' alignment is %d, LLVM expected %d\n",
971971
LongDoubleAlign, TripleLayouts.LongDoubleAlign);
972972
fprintf(
973-
stderr, "'long double' format got %d, expected %d\n",
973+
stderr, "Clang's long double' format is %d, LLVM expected %d\n",
974974
llvm::APFloatBase::SemanticsToEnum(*LongDoubleFormat),
975975
llvm::APFloatBase::SemanticsToEnum(*TripleLayouts.LongDoubleFormat));
976976
llvm_unreachable("Clang & LLVM layout mismatch");

clang/lib/Basic/Targets/ARM.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ using namespace clang::targets;
2525
void ARMTargetInfo::setABIAAPCS() {
2626
IsAAPCS = true;
2727

28+
fprintf(stderr, "setabiaapcs");
2829
DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 64;
2930
BFloat16Width = BFloat16Align = 16;
3031
BFloat16Format = &llvm::APFloat::BFloat();
@@ -75,6 +76,7 @@ void ARMTargetInfo::setABIAPCS(bool IsAAPCS16) {
7576

7677
IsAAPCS = false;
7778

79+
fprintf(stderr, "is aapcs16 %d\n", IsAAPCS);
7880
if (IsAAPCS16)
7981
DoubleAlign = LongLongAlign = LongDoubleAlign = SuitableAlign = 64;
8082
else

llvm/include/llvm/TargetParser/Triple.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1279,12 +1279,12 @@ class Triple {
12791279

12801280
/// Provide default layouts relevant to C. Frontends may override these
12811281
/// values.
1282-
CLayouts getCLayouts() const;
1282+
CLayouts getCLayouts(const StringRef &ABIName) const;
12831283

12841284
/// Return true if `long double` and `__float128` have the same layout.
1285-
bool isLongDoubleF128() const {
1285+
bool isLongDoubleF128(const StringRef &ABIName) const {
12861286
// TODO: do we also need to check alignment?
1287-
return getCLayouts().LongDoubleWidth == 128;
1287+
return getCLayouts(ABIName).LongDoubleWidth == 128;
12881288
}
12891289
};
12901290

llvm/lib/TargetParser/Triple.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2164,7 +2164,7 @@ VersionTuple Triple::getCanonicalVersionForOS(OSType OSKind,
21642164
}
21652165
}
21662166

2167-
Triple::CLayouts Triple::getCLayouts() const {
2167+
Triple::CLayouts Triple::getCLayouts(const StringRef &ABIName) const {
21682168
Triple::CLayouts Layouts;
21692169

21702170
// Default to a 32-bit RISC platform

0 commit comments

Comments
 (0)