forked from OSchip/llvm-project
Commit patch reverted in r153454 with the modified test
case that I forgot to check in. llvm-svn: 153512
This commit is contained in:
parent
9c1ad5cb7d
commit
38c59108ad
|
@ -3200,6 +3200,7 @@ 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 &&
|
||||
|
@ -3209,7 +3210,7 @@ void RewriteModernObjC::RewriteIvarOffsetSymbols(ObjCInterfaceDecl *CDecl,
|
|||
if (CDecl->getImplementation())
|
||||
Result += "__declspec(dllexport) ";
|
||||
}
|
||||
Result += "extern unsigned long ";
|
||||
Result += "unsigned long ";
|
||||
WriteInternalIvarName(CDecl, IvarDecl, Result);
|
||||
Result += ";";
|
||||
}
|
||||
|
@ -5420,7 +5421,7 @@ static void WriteModernMetadataDeclarations(ASTContext *Context, std::string &Re
|
|||
Result += "\tconst struct _prop_list_t *properties;\n";
|
||||
Result += "};\n";
|
||||
|
||||
Result += "__declspec(dllimport) extern struct objc_cache _objc_empty_cache;\n";
|
||||
Result += "extern \"C\" __declspec(dllimport) struct objc_cache _objc_empty_cache;\n";
|
||||
|
||||
meta_data_declared = true;
|
||||
}
|
||||
|
@ -5660,26 +5661,29 @@ 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 += "extern struct _class_t OBJC_CLASS_$_";
|
||||
Result += "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 += "extern struct _class_t ";
|
||||
Result += "struct _class_t ";
|
||||
Result += VarName;
|
||||
Result += CDecl->getSuperClass()->getNameAsString();
|
||||
Result += ";\n";
|
||||
|
||||
if (metaclass) {
|
||||
Result += "extern \"C\" ";
|
||||
if (RootClass->getImplementation())
|
||||
Result += "__declspec(dllexport) ";
|
||||
Result += "extern struct _class_t ";
|
||||
Result += "struct _class_t ";
|
||||
Result += VarName;
|
||||
Result += RootClass->getNameAsString();
|
||||
Result += ";\n";
|
||||
|
@ -5790,10 +5794,11 @@ 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 += "extern struct _class_t ";
|
||||
Result += "struct _class_t ";
|
||||
Result += "OBJC_CLASS_$_"; Result += ClassName;
|
||||
Result += ";\n";
|
||||
|
||||
|
|
|
@ -28,4 +28,4 @@ void *sel_registerName(const char *);
|
|||
// CHECK: id obj = (*(id *)((char *)newInv + OBJC_IVAR_$_NSInvocation$_container));
|
||||
// rdar://11076938
|
||||
// CHECK: struct _class_t *superclass;
|
||||
// CHECK: __declspec(dllimport) extern struct objc_cache _objc_empty_cache;
|
||||
// CHECK: extern "C" __declspec(dllimport) struct objc_cache _objc_empty_cache;
|
||||
|
|
Loading…
Reference in New Issue