diff options
Diffstat (limited to 'clang/lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGObjC.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/clang/lib/CodeGen/CGObjC.cpp b/clang/lib/CodeGen/CGObjC.cpp index 929bda9099b..50252d5a44b 100644 --- a/clang/lib/CodeGen/CGObjC.cpp +++ b/clang/lib/CodeGen/CGObjC.cpp @@ -1469,11 +1469,6 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ if (DI) DI->EmitLexicalBlockStart(Builder, S.getSourceRange().getBegin()); - // The local variable comes into scope immediately. - AutoVarEmission variable = AutoVarEmission::invalid(); - if (const DeclStmt *SD = dyn_cast<DeclStmt>(S.getElement())) - variable = EmitAutoVarAlloca(*cast<VarDecl>(SD->getSingleDecl())); - JumpDest LoopEnd = getJumpDestInCurrentScope("forcoll.end"); // Fast enumeration state. @@ -1625,8 +1620,10 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ bool elementIsVariable; LValue elementLValue; QualType elementType; + AutoVarEmission variable = AutoVarEmission::invalid(); if (const DeclStmt *SD = dyn_cast<DeclStmt>(S.getElement())) { // Initialize the variable, in case it's a __block variable or something. + variable = EmitAutoVarAlloca(*cast<VarDecl>(SD->getSingleDecl())); EmitAutoVarInit(variable); const VarDecl* D = cast<VarDecl>(SD->getSingleDecl()); |