aeubanks created this revision. Herald added a reviewer: aaron.ballman. aeubanks requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits.
Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D101561 Files: clang/include/clang/Basic/Attr.td clang/include/clang/Basic/AttrDocs.td clang/lib/CodeGen/TargetInfo.cpp Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -4204,6 +4204,8 @@ if (RT->getDecl()->hasFlexibleArrayMember()) return getNaturalAlignIndirect(Ty, /*ByVal=*/false); + if (RT->getDecl()->hasAttr<UnstableABIAttr>()) + return ABIArgInfo::getDirect(); } const Type *Base = nullptr; Index: clang/include/clang/Basic/AttrDocs.td =================================================================== --- clang/include/clang/Basic/AttrDocs.td +++ clang/include/clang/Basic/AttrDocs.td @@ -3150,6 +3150,12 @@ }]; } +def UnstableABIDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ + }]; +} + def MSInheritanceDocs : Documentation { let Category = DocCatDecl; let Heading = "__single_inhertiance, __multiple_inheritance, __virtual_inheritance"; Index: clang/include/clang/Basic/Attr.td =================================================================== --- clang/include/clang/Basic/Attr.td +++ clang/include/clang/Basic/Attr.td @@ -1538,6 +1538,16 @@ let SimpleHandler = 1; } +def UnstableABI : InheritableAttr { + // This attribute does not have a C [[]] spelling because it requires the + // CPlusPlus language option. + let Spellings = [Clang<"unstable_abi", 0>]; + let Subjects = SubjectList<[CXXRecord]>; + let Documentation = [UnstableABIDocs]; + let LangOpts = [CPlusPlus]; + let SimpleHandler = 1; +} + def MaxFieldAlignment : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = [];
Index: clang/lib/CodeGen/TargetInfo.cpp =================================================================== --- clang/lib/CodeGen/TargetInfo.cpp +++ clang/lib/CodeGen/TargetInfo.cpp @@ -4204,6 +4204,8 @@ if (RT->getDecl()->hasFlexibleArrayMember()) return getNaturalAlignIndirect(Ty, /*ByVal=*/false); + if (RT->getDecl()->hasAttr<UnstableABIAttr>()) + return ABIArgInfo::getDirect(); } const Type *Base = nullptr; Index: clang/include/clang/Basic/AttrDocs.td =================================================================== --- clang/include/clang/Basic/AttrDocs.td +++ clang/include/clang/Basic/AttrDocs.td @@ -3150,6 +3150,12 @@ }]; } +def UnstableABIDocs : Documentation { + let Category = DocCatDecl; + let Content = [{ + }]; +} + def MSInheritanceDocs : Documentation { let Category = DocCatDecl; let Heading = "__single_inhertiance, __multiple_inheritance, __virtual_inheritance"; Index: clang/include/clang/Basic/Attr.td =================================================================== --- clang/include/clang/Basic/Attr.td +++ clang/include/clang/Basic/Attr.td @@ -1538,6 +1538,16 @@ let SimpleHandler = 1; } +def UnstableABI : InheritableAttr { + // This attribute does not have a C [[]] spelling because it requires the + // CPlusPlus language option. + let Spellings = [Clang<"unstable_abi", 0>]; + let Subjects = SubjectList<[CXXRecord]>; + let Documentation = [UnstableABIDocs]; + let LangOpts = [CPlusPlus]; + let SimpleHandler = 1; +} + def MaxFieldAlignment : InheritableAttr { // This attribute has no spellings as it is only ever created implicitly. let Spellings = [];
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits