-Add missing visitor for ObjCIvarRefExpr.
-Wrap objc runtime calls with "extern "C"" (for now).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@48284 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp
index 6ad362a..5e6d426 100644
--- a/Driver/RewriteTest.cpp
+++ b/Driver/RewriteTest.cpp
@@ -281,7 +281,9 @@
S += "typedef struct objc_object Protocol;\n";
S += "#define _REWRITER_typedef_Protocol\n";
S += "#endif\n";
- S += "extern struct objc_object *objc_msgSend";
+ if (LangOpts.Microsoft)
+ S += "extern \"C\" {\n";
+ S += "struct objc_object *objc_msgSend";
S += "(struct objc_object *, struct objc_selector *, ...);\n";
S += "extern struct objc_object *objc_msgSendSuper";
S += "(struct objc_super *, struct objc_selector *, ...);\n";
@@ -291,7 +293,7 @@
S += "(struct objc_super *, struct objc_selector *, ...);\n";
S += "extern struct objc_object *objc_msgSend_fpret";
S += "(struct objc_object *, struct objc_selector *, ...);\n";
- S += "extern struct objc_object *objc_getClass";
+ S += "struct objc_object *objc_getClass";
S += "(const char *);\n";
S += "extern struct objc_object *objc_getMetaClass";
S += "(const char *);\n";
@@ -302,6 +304,8 @@
S += "extern int objc_exception_match";
S += "(struct objc_class *, struct objc_object *, ...);\n";
S += "extern Protocol *objc_getProtocol(const char *);\n";
+ if (LangOpts.Microsoft)
+ S += "} // end extern \"C\"\n";
S += "#include <objc/objc.h>\n";
S += "#ifndef __FASTENUMERATIONSTATE\n";
S += "struct __objcFastEnumerationState {\n\t";
@@ -1967,6 +1971,7 @@
SourceLocation());
MsgExprs.push_back(Unop);
} else {
+ //recExpr->dump();
// Remove all type-casts because it may contain objc-style types; e.g.
// Foo<Proto> *.
while (CastExpr *CE = dyn_cast<CastExpr>(recExpr))