[cfe-commits] r153674 - /cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Thu Mar 29 12:04:11 PDT 2012
Author: fjahanian
Date: Thu Mar 29 14:04:10 2012
New Revision: 153674
URL: http://llvm.org/viewvc/llvm-project?rev=153674&view=rev
Log:
modern objc translator: avoid some duplicate declarations.
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=153674&r1=153673&r2=153674&view=diff
==============================================================================
--- cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp (original)
+++ cfe/trunk/lib/Rewrite/RewriteModernObjC.cpp Thu Mar 29 14:04:10 2012
@@ -5689,19 +5689,20 @@
}
// Also, for possibility of 'super' metadata class not having been defined yet.
if (!rootClass) {
+ ObjCInterfaceDecl *SuperClass = CDecl->getSuperClass();
Result += "\n";
Result += "extern \"C\" ";
- if (CDecl->getSuperClass()->getImplementation())
+ if (SuperClass->getImplementation())
Result += "__declspec(dllexport) ";
else
Result += "__declspec(dllimport) ";
Result += "struct _class_t ";
Result += VarName;
- Result += CDecl->getSuperClass()->getNameAsString();
+ Result += SuperClass->getNameAsString();
Result += ";\n";
- if (metaclass) {
+ if (metaclass && RootClass != SuperClass) {
Result += "extern \"C\" ";
if (RootClass->getImplementation())
Result += "__declspec(dllexport) ";
More information about the cfe-commits
mailing list