[cfe-commits] r152500 - /cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Sat Mar 10 10:25:07 PST 2012
Author: fjahanian
Date: Sat Mar 10 12:25:06 2012
New Revision: 152500
URL: http://llvm.org/viewvc/llvm-project?rev=152500&view=rev
Log:
objective-c modern rewriter: add __declspec(dllexport) to forward
declaration of class metadata when they are defined later.
Modified:
cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Modified: cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp?rev=152500&r1=152499&r2=152500&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Sat Mar 10 12:25:06 2012
@@ -5682,13 +5682,20 @@
if (metadata && !CDecl->getSuperClass()) {
// Need to handle a case of use of forward declaration.
- Result += "\nextern struct _class_t OBJC_CLASS_$_";
+ Result += "\n";
+ if (CDecl->getImplementation())
+ Result += "__declspec(dllexport) ";
+ Result += "extern struct _class_t OBJC_CLASS_$_";
Result += CDecl->getNameAsString();
Result += ";\n";
}
// Also, for possibility of 'super' metadata class not having been defined yet.
if (CDecl->getSuperClass()) {
- Result += "\nextern struct _class_t "; Result += VarName;
+ Result += "\n";
+ if (CDecl->getSuperClass()->getImplementation())
+ Result += "__declspec(dllexport) ";
+ Result += "extern struct _class_t ";
+ Result += VarName;
Result += CDecl->getSuperClass()->getNameAsString();
Result += ";\n";
}
More information about the cfe-commits
mailing list