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 {
8113
8113
// / instance method.
8114
8114
bool isObjCInstanceMethod () const ;
8115
8115
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
+
8116
8121
// / Determine whether the name of an argument is an API name by default
8117
8122
// / depending on the function context.
8118
8123
bool argumentNameIsAPIByDefault () const ;
Original file line number Diff line number Diff line change @@ -10451,6 +10451,15 @@ bool AbstractFunctionDecl::isObjCInstanceMethod() const {
10451
10451
return isInstanceMember () || isa<ConstructorDecl>(this );
10452
10452
}
10453
10453
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
+
10454
10463
bool AbstractFunctionDecl::needsNewVTableEntry () const {
10455
10464
auto &ctx = getASTContext ();
10456
10465
return evaluateOrDefault (
You can’t perform that action at this time.
0 commit comments