]> granicus.if.org Git - clang/commitdiff
Explicitly access the first Decl* referenced by a DeclStmt instead of using "getDecl...
authorTed Kremenek <kremenek@apple.com>
Mon, 6 Oct 2008 22:45:07 +0000 (22:45 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 6 Oct 2008 22:45:07 +0000 (22:45 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57216 91177308-0d34-0410-b5e6-96231b3b80d8

Driver/RewriteObjC.cpp

index 708c8446776c181d269557903dfe256cc509d3d9..316c1761eabe5aff60cf4f2a399965cc39f5776b 100644 (file)
@@ -1026,9 +1026,15 @@ Stmt *RewriteObjC::RewriteFunctionBodyOrGlobalInitializer(Stmt *S) {
       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);