[cfe-commits] r57216 - /cfe/trunk/Driver/RewriteObjC.cpp

Ted Kremenek kremenek at apple.com
Mon Oct 6 15:45:08 PDT 2008


Author: kremenek
Date: Mon Oct  6 17:45:07 2008
New Revision: 57216

URL: http://llvm.org/viewvc/llvm-project?rev=57216&view=rev
Log:
Explicitly access the first Decl* referenced by a DeclStmt instead of using "getDecl()."  Added a FIXME indicating that the call to RewriteObjCQualifiedInterfaceTypes() is meant to modifying the type-specifier; hopefully this will be a little more clean once DeclGroups contain type specifiers.

Modified:
    cfe/trunk/Driver/RewriteObjC.cpp

Modified: cfe/trunk/Driver/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/RewriteObjC.cpp?rev=57216&r1=57215&r2=57216&view=diff

==============================================================================
--- cfe/trunk/Driver/RewriteObjC.cpp (original)
+++ cfe/trunk/Driver/RewriteObjC.cpp Mon Oct  6 17:45:07 2008
@@ -1026,9 +1026,15 @@
       dyn_cast<ContinueStmt>(S))
     return RewriteContinueStmt(StmtContinueStmt);
 	
-  // Need to check for protocol refs (id <P>, Foo <P> *) in variable decls and cast exprs.
-  if (DeclStmt *DS = dyn_cast<DeclStmt>(S))
-    RewriteObjCQualifiedInterfaceTypes(DS->getDecl());
+  // Need to check for protocol refs (id <P>, Foo <P> *) in variable decls 
+  // and cast exprs.
+  if (DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
+    // FIXME: What we're doing here is modifying the type-specifier that
+    // precedes the first Decl.  In the future the DeclGroup should have
+    // a separate type-specifier that we can rewrite.    
+    RewriteObjCQualifiedInterfaceTypes(*DS->decl_begin());
+  }
+  
   if (ExplicitCastExpr *CE = dyn_cast<ExplicitCastExpr>(S))
     RewriteObjCQualifiedInterfaceTypes(CE);
   





More information about the cfe-commits mailing list