[cfe-commits] r48284 - in /cfe/trunk: AST/StmtDumper.cpp Driver/RewriteTest.cpp
Steve Naroff
snaroff at apple.com
Wed Mar 12 06:19:13 PDT 2008
Author: snaroff
Date: Wed Mar 12 08:19:12 2008
New Revision: 48284
URL: http://llvm.org/viewvc/llvm-project?rev=48284&view=rev
Log:
-Add missing visitor for ObjCIvarRefExpr.
-Wrap objc runtime calls with "extern "C"" (for now).
Modified:
cfe/trunk/AST/StmtDumper.cpp
cfe/trunk/Driver/RewriteTest.cpp
Modified: cfe/trunk/AST/StmtDumper.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/AST/StmtDumper.cpp?rev=48284&r1=48283&r2=48284&view=diff
==============================================================================
--- cfe/trunk/AST/StmtDumper.cpp (original)
+++ cfe/trunk/AST/StmtDumper.cpp Wed Mar 12 08:19:12 2008
@@ -136,6 +136,7 @@
void VisitObjCMessageExpr(ObjCMessageExpr* Node);
void VisitObjCSelectorExpr(ObjCSelectorExpr *Node);
void VisitObjCProtocolExpr(ObjCProtocolExpr *Node);
+ void VisitObjCIvarRefExpr(ObjCIvarRefExpr *Node);
};
}
@@ -293,6 +294,13 @@
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()) {
Modified: cfe/trunk/Driver/RewriteTest.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteTest.cpp?rev=48284&r1=48283&r2=48284&view=diff
==============================================================================
--- cfe/trunk/Driver/RewriteTest.cpp (original)
+++ cfe/trunk/Driver/RewriteTest.cpp Wed Mar 12 08:19:12 2008
@@ -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))
More information about the cfe-commits
mailing list