[cfe-commits] r101953 - /cfe/trunk/lib/AST/Decl.cpp
Ted Kremenek
kremenek at apple.com
Tue Apr 20 16:15:35 PDT 2010
Author: kremenek
Date: Tue Apr 20 18:15:35 2010
New Revision: 101953
URL: http://llvm.org/viewvc/llvm-project?rev=101953&view=rev
Log:
Specify linkage for Objective-C declarations.
Modified:
cfe/trunk/lib/AST/Decl.cpp
Modified: cfe/trunk/lib/AST/Decl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/Decl.cpp?rev=101953&r1=101952&r2=101953&view=diff
==============================================================================
--- cfe/trunk/lib/AST/Decl.cpp (original)
+++ cfe/trunk/lib/AST/Decl.cpp Tue Apr 20 18:15:35 2010
@@ -286,6 +286,29 @@
}
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))
More information about the cfe-commits
mailing list