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 | 3c64d9eaa092ac65c39e381f4a49689cf994d666 (patch) | |
tree | 564e4baef6ab6d3adec333f93dde81d45cc573d5 | |
parent | b1f4080d1677f575100ced197d8e127915e18af8 (diff) |
-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
-rw-r--r-- | AST/StmtDumper.cpp | 8 | ||||
-rw-r--r-- | Driver/RewriteTest.cpp | 9 |
2 files changed, 15 insertions, 2 deletions
diff --git a/AST/StmtDumper.cpp b/AST/StmtDumper.cpp index 66411f1730..d813899b53 100644 --- a/AST/StmtDumper.cpp +++ b/AST/StmtDumper.cpp @@ -136,6 +136,7 @@ namespace { void VisitObjCMessageExpr(ObjCMessageExpr* Node); void VisitObjCSelectorExpr(ObjCSelectorExpr *Node); void VisitObjCProtocolExpr(ObjCProtocolExpr *Node); + void VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node); }; } @@ -293,6 +294,13 @@ void StmtDumper::VisitDeclRefExpr(DeclRefExpr *Node) { fprintf(F, "='%s' %p", Node->getDecl()->getName(), (void*)Node->getDecl()); } +void StmtDumper::VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node) { + DumpExpr(Node->getBase()); + + fprintf(F, " ObjCIvarRefExpr"); + fprintf(F, "='%s' %p", Node->getDecl()->getName(), (void*)Node->getDecl()); +} + void StmtDumper::VisitPreDefinedExpr(PreDefinedExpr *Node) { DumpExpr(Node); switch (Node->getIdentType()) { diff --git a/Driver/RewriteTest.cpp b/Driver/RewriteTest.cpp index 6ad362a2a0..5e6d4262c0 100644 --- a/Driver/RewriteTest.cpp +++ b/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)) |