aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/CGStmt.cpp
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2010-08-25 00:28:56 +0000
committerDevang Patel <dpatel@apple.com>2010-08-25 00:28:56 +0000
commit0554e0e30d24d9ad7d5e12f8e7583ebb5c9715bf (patch)
tree3f6b20178f2b53c3ac1de21d876934c3aeead004 /lib/CodeGen/CGStmt.cpp
parenteb0d0145910f3024d9bdefe279a1e9b95495f2fd (diff)
Fix 'for' loop variables' scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@112002 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGStmt.cpp')
-rw-r--r--lib/CodeGen/CGStmt.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/CodeGen/CGStmt.cpp b/lib/CodeGen/CGStmt.cpp
index 3a6c44aba0..16145f766a 100644
--- a/lib/CodeGen/CGStmt.cpp
+++ b/lib/CodeGen/CGStmt.cpp
@@ -501,6 +501,12 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S) {
RunCleanupsScope ForScope(*this);
+ CGDebugInfo *DI = getDebugInfo();
+ if (DI) {
+ DI->setLocation(S.getSourceRange().getBegin());
+ DI->EmitRegionStart(Builder);
+ }
+
// Evaluate the first part before the loop.
if (S.getInit())
EmitStmt(S.getInit());
@@ -558,12 +564,6 @@ void CodeGenFunction::EmitForStmt(const ForStmt &S) {
// Store the blocks to use for break and continue.
BreakContinueStack.push_back(BreakContinue(LoopExit, Continue));
- CGDebugInfo *DI = getDebugInfo();
- if (DI) {
- DI->setLocation(S.getSourceRange().getBegin());
- DI->EmitRegionStart(Builder);
- }
-
{
// Create a separate cleanup scope for the body, in case it is not
// a compound statement.