]> granicus.if.org Git - clang/commitdiff
objc modern rewriter: Mark class and ivar definitions with __declspec(dllexport)
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 10 Mar 2012 00:39:34 +0000 (00:39 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 10 Mar 2012 00:39:34 +0000 (00:39 +0000)
// rdar://11023563

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152459 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Rewrite/RewriteModernObjC.cpp

index 111de2e49587fcfa62bc0ba1ee9b69ad53975424..37b02b8ece823d13a3793e55710026089b46fe7a 100644 (file)
@@ -5703,7 +5703,7 @@ static void Write_class_t(ASTContext *Context, std::string &Result,
     Result += ";\n";
   }
   
-  Result += "\nstruct _class_t "; Result += VarName; Result += CDecl->getNameAsString();
+  Result += "\n__declspec(dllexport) struct _class_t "; Result += VarName; Result += CDecl->getNameAsString();
   Result += " __attribute__ ((used, section (\"__DATA,__objc_data\"))) = {\n";
   Result += "\t";
   if (metadata) {
@@ -5849,7 +5849,7 @@ static void Write_IvarOffsetVar(std::string &Result,
   Result += "\n";
   for (unsigned i =0, e = Ivars.size(); i < e; i++) {
     ObjCIvarDecl *IvarDecl = Ivars[i];
-    Result += "unsigned long int "; Result += VarName;
+    Result += "__declspec(dllexport) unsigned long int "; Result += VarName;
     Result += ClassName; Result += "_";
     Result += IvarDecl->getName(); 
     Result += " __attribute__ ((used, section (\"__DATA,__objc_ivar\")))";