diff options
author | Steve Naroff <snaroff@apple.com> | 2008-03-12 13:19:12 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-03-12 13:19:12 +0000 |
commit | 5d5efca405f1a785c0dbdd8e4d32294feaf7a14c (patch) | |
tree | 620af2bd5fbc2617e2b9e88f42c8d38049e9afe7 /clang/Driver/RewriteTest.cpp | |
parent | 136a24742c63863077fc5d914cf3e9755b15d85b (diff) | |
download | bcm5719-llvm-5d5efca405f1a785c0dbdd8e4d32294feaf7a14c.tar.gz bcm5719-llvm-5d5efca405f1a785c0dbdd8e4d32294feaf7a14c.zip |
-Add missing visitor for ObjCIvarRefExpr.
-Wrap objc runtime calls with "extern "C"" (for now).
llvm-svn: 48284
Diffstat (limited to 'clang/Driver/RewriteTest.cpp')
-rw-r--r-- | clang/Driver/RewriteTest.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/clang/Driver/RewriteTest.cpp b/clang/Driver/RewriteTest.cpp index 6ad362a2a0b..5e6d4262c03 100644 --- a/clang/Driver/RewriteTest.cpp +++ b/clang/Driver/RewriteTest.cpp @@ -281,7 +281,9 @@ void RewriteTest::Initialize(ASTContext &context) { 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 @@ void RewriteTest::Initialize(ASTContext &context) { 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 @@ void RewriteTest::Initialize(ASTContext &context) { 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 @@ Stmt *RewriteTest::SynthMessageExpr(ObjCMessageExpr *Exp) { 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)) |