forked from OSchip/llvm-project
In RewriteFunctionBody, using DeclStmt::decl_iterator to rewrite the Decls in a DeclStmt instead of using getDecl() to fetch the first Decl.
Steve: Please review this patch. 'make test' passes, and my cursory scan of the rewriter leads me to believe this doesn't break anything, but I'm not sure. llvm-svn: 57195
This commit is contained in:
parent
4db44b62ad
commit
53532c1fda
|
@ -1014,14 +1014,18 @@ Stmt *RewriteBlocks::RewriteFunctionBody(Stmt *S) {
|
|||
RewriteBlockCall(CE);
|
||||
}
|
||||
if (DeclStmt *DS = dyn_cast<DeclStmt>(S)) {
|
||||
ScopedDecl *SD = DS->getDecl();
|
||||
if (ValueDecl *ND = dyn_cast<ValueDecl>(SD)) {
|
||||
if (isBlockPointerType(ND->getType()))
|
||||
RewriteBlockPointerDecl(ND);
|
||||
}
|
||||
if (TypedefDecl *TD = dyn_cast<TypedefDecl>(SD)) {
|
||||
if (isBlockPointerType(TD->getUnderlyingType()))
|
||||
RewriteBlockPointerDecl(TD);
|
||||
for (DeclStmt::decl_iterator DI = DS->decl_begin(), DE = DS->decl_end();
|
||||
DI != DE; ++DI) {
|
||||
|
||||
ScopedDecl *SD = *DI;
|
||||
if (ValueDecl *ND = dyn_cast<ValueDecl>(SD)) {
|
||||
if (isBlockPointerType(ND->getType()))
|
||||
RewriteBlockPointerDecl(ND);
|
||||
}
|
||||
if (TypedefDecl *TD = dyn_cast<TypedefDecl>(SD)) {
|
||||
if (isBlockPointerType(TD->getUnderlyingType()))
|
||||
RewriteBlockPointerDecl(TD);
|
||||
}
|
||||
}
|
||||
}
|
||||
// Handle specific things.
|
||||
|
|
Loading…
Reference in New Issue