aboutsummaryrefslogtreecommitdiff
path: root/Driver/RewriteObjC.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-10-06 22:45:07 +0000
committerTed Kremenek <kremenek@apple.com>2008-10-06 22:45:07 +0000
commitab9bae758342e11a5d6b27e26adffe802394cfd1 (patch)
tree851caf16b6b007bfccc0eb67e62e62bce4eec01f /Driver/RewriteObjC.cpp
parent50a25e25db80664255b5777c71303a9308e60125 (diff)
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57216 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Driver/RewriteObjC.cpp')
-rw-r--r--Driver/RewriteObjC.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/Driver/RewriteObjC.cpp b/Driver/RewriteObjC.cpp
index 708c844677..316c1761ea 100644
--- a/Driver/RewriteObjC.cpp
+++ b/Driver/RewriteObjC.cpp
@@ -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);