[cfe-commits] r153127 - /cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Tue Mar 20 14:09:59 PDT 2012
Author: fjahanian
Date: Tue Mar 20 16:09:58 2012
New Revision: 153127
URL: http://llvm.org/viewvc/llvm-project?rev=153127&view=rev
Log:
more modern objective-c meta-data stuff.
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=153127&r1=153126&r2=153127&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Tue Mar 20 16:09:58 2012
@@ -5625,6 +5625,15 @@
Result += VarName;
Result += CDecl->getSuperClass()->getNameAsString();
Result += ";\n";
+
+ if (metaclass) {
+ if (RootClass->getImplementation())
+ Result += "__declspec(dllexport) ";
+ Result += "extern struct _class_t ";
+ Result += VarName;
+ Result += RootClass->getNameAsString();
+ Result += ";\n";
+ }
}
Result += "\n__declspec(dllexport) struct _class_t "; Result += VarName; Result += CDecl->getNameAsString();
@@ -5640,7 +5649,7 @@
Result += ",\n\t";
}
else {
- Result += "0, // "; Result += VarName;
+ Result += "0, // &"; Result += VarName;
Result += CDecl->getNameAsString();
Result += ",\n\t";
Result += "0, // &OBJC_CLASS_$_"; Result += CDecl->getNameAsString();
@@ -5681,10 +5690,15 @@
Result += "(void ) {\n";
Result += "\tOBJC_METACLASS_$_"; Result += CDecl->getNameAsString();
Result += ".isa = "; Result += "&OBJC_METACLASS_$_";
- Result += CDecl->getNameAsString(); Result += ";\n";
+ Result += RootClass->getNameAsString(); Result += ";\n";
Result += "\tOBJC_METACLASS_$_"; Result += CDecl->getNameAsString();
- Result += ".superclass = "; Result += "&OBJC_METACLASS_$_";
+ Result += ".superclass = ";
+ if (rootClass)
+ Result += "&OBJC_CLASS_$_";
+ else
+ Result += "&OBJC_METACLASS_$_";
+
Result += SuperClass->getNameAsString(); Result += ";\n";
Result += "\tOBJC_METACLASS_$_"; Result += CDecl->getNameAsString();
More information about the cfe-commits
mailing list