In EmitDeclStmt: use DeclStmt::const_decl_iterator instead of walking the scoped decl chain.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@57192 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index f70b866..024fb0a 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -482,9 +482,9 @@
}
void CodeGenFunction::EmitDeclStmt(const DeclStmt &S) {
- for (const ScopedDecl *Decl = S.getDecl(); Decl;
- Decl = Decl->getNextDeclarator())
- EmitDecl(*Decl);
+ for (DeclStmt::const_decl_iterator I = S.decl_begin(), E = S.decl_end();
+ I != E; ++I)
+ EmitDecl(**I);
}
void CodeGenFunction::EmitBreakStmt() {