File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -8113,6 +8113,11 @@ class AbstractFunctionDecl : public GenericContext, public ValueDecl {
81138113 // / instance method.
81148114 bool isObjCInstanceMethod () const ;
81158115
8116+ // / Get the foreign language targeted by a @cdecl-style attribute, if any.
8117+ // / Used to abstract away the change in meaning of @cdecl vs @_cdecl while
8118+ // / formalizing the attribute.
8119+ std::optional<ForeignLanguage> getCDeclKind () const ;
8120+
81168121 // / Determine whether the name of an argument is an API name by default
81178122 // / depending on the function context.
81188123 bool argumentNameIsAPIByDefault () const ;
Original file line number Diff line number Diff line change @@ -10451,6 +10451,15 @@ bool AbstractFunctionDecl::isObjCInstanceMethod() const {
1045110451 return isInstanceMember () || isa<ConstructorDecl>(this );
1045210452}
1045310453
10454+ std::optional<ForeignLanguage> AbstractFunctionDecl::getCDeclKind () const {
10455+ auto attr = getAttrs ().getAttribute <CDeclAttr>();
10456+ if (!attr)
10457+ return std::nullopt ;
10458+
10459+ return attr->Underscored ? ForeignLanguage::ObjectiveC
10460+ : ForeignLanguage::C;
10461+ }
10462+
1045410463bool AbstractFunctionDecl::needsNewVTableEntry () const {
1045510464 auto &ctx = getASTContext ();
1045610465 return evaluateOrDefault (
You can’t perform that action at this time.
0 commit comments