diff options
| author | Ted Kremenek <kremenek@apple.com> | 2010-04-20 23:15:35 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2010-04-20 23:15:35 +0000 |
| commit | 926d86089f2f2dd6b2d0dcb7b91559a2a1c92a4b (patch) | |
| tree | 47aa13d8268cc611c9069df05ceb4e3b1f17e942 | |
| parent | cedc0a469f7eaf3d3cc8a2946fe1dddf66fe2604 (diff) | |
| download | bcm5719-llvm-926d86089f2f2dd6b2d0dcb7b91559a2a1c92a4b.tar.gz bcm5719-llvm-926d86089f2f2dd6b2d0dcb7b91559a2a1c92a4b.zip | |
Specify linkage for Objective-C declarations.
llvm-svn: 101953
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index b02cbdeb262..b11f61757db 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -286,6 +286,29 @@ static Linkage getLinkageForNamespaceScopeDecl(const NamedDecl *D) { } Linkage NamedDecl::getLinkage() const { + + // Objective-C: treat all Objective-C declarations as having external + // linkage. + switch (getKind()) { + default: + break; + case Decl::ObjCAtDefsField: + case Decl::ObjCCategory: + case Decl::ObjCCategoryImpl: + case Decl::ObjCClass: + case Decl::ObjCCompatibleAlias: + case Decl::ObjCContainer: + case Decl::ObjCForwardProtocol: + case Decl::ObjCImplementation: + case Decl::ObjCInterface: + case Decl::ObjCIvar: + case Decl::ObjCMethod: + case Decl::ObjCProperty: + case Decl::ObjCPropertyImpl: + case Decl::ObjCProtocol: + return ExternalLinkage; + } + // Handle linkage for namespace-scope names. if (getDeclContext()->getLookupContext()->isFileContext()) if (Linkage L = getLinkageForNamespaceScopeDecl(this)) |

