diff options
author | Daniel Dunbar <daniel@zuster.org> | 2012-03-26 18:48:59 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2012-03-26 18:48:59 +0000 |
commit | ad11f1c66831cb1a6fc9223493afbb16e34926b1 (patch) | |
tree | 89b84c071b8a64fd30a5a9eed7cc6452a99802a9 /lib/Rewrite/RewriteModernObjC.cpp | |
parent | 4cd7edfa851ff5d9b37d09539a77685a12e82994 (diff) |
Revert r153443 "objective-c modern translator: extern "C" exported", it fails in testing.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153454 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Rewrite/RewriteModernObjC.cpp')
-rw-r--r-- | lib/Rewrite/RewriteModernObjC.cpp | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/Rewrite/RewriteModernObjC.cpp b/lib/Rewrite/RewriteModernObjC.cpp index c4f721f8c2..c0f7ea4d53 100644 --- a/lib/Rewrite/RewriteModernObjC.cpp +++ b/lib/Rewrite/RewriteModernObjC.cpp @@ -3200,7 +3200,6 @@ void RewriteModernObjC::RewriteIvarOffsetSymbols(ObjCInterfaceDecl *CDecl, e = Ivars.end(); i != e; i++) { ObjCIvarDecl *IvarDecl = (*i); Result += "\n"; - Result += "extern \"C\" "; if (LangOpts.MicrosoftExt) Result += "__declspec(allocate(\".objc_ivar$B\")) "; if (LangOpts.MicrosoftExt && @@ -3210,7 +3209,7 @@ void RewriteModernObjC::RewriteIvarOffsetSymbols(ObjCInterfaceDecl *CDecl, if (CDecl->getImplementation()) Result += "__declspec(dllexport) "; } - Result += "unsigned long "; + Result += "extern unsigned long "; WriteInternalIvarName(CDecl, IvarDecl, Result); Result += ";"; } @@ -5421,7 +5420,7 @@ static void WriteModernMetadataDeclarations(ASTContext *Context, std::string &Re Result += "\tconst struct _prop_list_t *properties;\n"; Result += "};\n"; - Result += "extern \"C\" __declspec(dllimport) struct objc_cache _objc_empty_cache;\n"; + Result += "__declspec(dllimport) extern struct objc_cache _objc_empty_cache;\n"; meta_data_declared = true; } @@ -5661,29 +5660,26 @@ static void Write_class_t(ASTContext *Context, std::string &Result, if (metaclass && rootClass) { // Need to handle a case of use of forward declaration. Result += "\n"; - Result += "extern \"C\" "; if (CDecl->getImplementation()) Result += "__declspec(dllexport) "; - Result += "struct _class_t OBJC_CLASS_$_"; + 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 (!rootClass) { Result += "\n"; - Result += "extern \"C\" "; if (CDecl->getSuperClass()->getImplementation()) Result += "__declspec(dllexport) "; - Result += "struct _class_t "; + Result += "extern struct _class_t "; Result += VarName; Result += CDecl->getSuperClass()->getNameAsString(); Result += ";\n"; if (metaclass) { - Result += "extern \"C\" "; if (RootClass->getImplementation()) Result += "__declspec(dllexport) "; - Result += "struct _class_t "; + Result += "extern struct _class_t "; Result += VarName; Result += RootClass->getNameAsString(); Result += ";\n"; @@ -5794,11 +5790,10 @@ static void Write_category_t(RewriteModernObjC &RewriteObj, ASTContext *Context, // must declare an extern class object in case this class is not implemented // in this TU. Result += "\n"; - Result += "extern \"C\" "; if (ClassDecl->getImplementation()) Result += "__declspec(dllexport) "; - Result += "struct _class_t "; + Result += "extern struct _class_t "; Result += "OBJC_CLASS_$_"; Result += ClassName; Result += ";\n"; |