diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-16 16:16:04 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-07-16 16:16:04 +0000 |
commit | 29eea29d7502eb1eeceb5cc9e6db91576a0c9107 (patch) | |
tree | 775f49c91493c9410c5ce5c69db24c527a8a1592 /lib/Sema/SemaDeclAttr.cpp | |
parent | 00bd3a18441f168ccde5d2db09073fec1e0e877c (diff) |
Objective-C. Introducing __attribute__((objc_runtime_name("runtimename"))
to be applied to class or protocols. This will direct IRGen
for Objective-C metadata to use the new name in various places
where class and protocol names are needed.
rdar:// 17631257
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213167 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index c87942d033..29be703320 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -3597,6 +3597,16 @@ static void handleObjCDesignatedInitializer(Sema &S, Decl *D, Attr.getAttributeSpellingListIndex())); } +static void handleObjCRuntimeName(Sema &S, Decl *D, + const AttributeList &Attr) { + StringRef MetaDataName; + if (!S.checkStringLiteralArgumentAttr(Attr, 0, MetaDataName)) + return; + D->addAttr(::new (S.Context) + ObjCRuntimeNameAttr(Attr.getRange(), S.Context, + MetaDataName, 0)); +} + static void handleObjCOwnershipAttr(Sema &S, Decl *D, const AttributeList &Attr) { if (hasDeclarator(D)) return; @@ -4246,6 +4256,10 @@ static void ProcessDeclAttribute(Sema &S, Scope *scope, Decl *D, handleObjCDesignatedInitializer(S, D, Attr); break; + case AttributeList::AT_ObjCRuntimeName: + handleObjCRuntimeName(S, D, Attr); + break; + case AttributeList::AT_CFAuditedTransfer: handleCFAuditedTransferAttr(S, D, Attr); break; |