Mercurial > projects > ldc
diff gen/llvmhelpers.cpp @ 1145:40caa8207b3e
Moved IRTargetScopeS from IRState into IrFunction, fixes #240 .
author | Tomas Lindquist Olsen <tomas.l.olsen gmail.com> |
---|---|
date | Thu, 26 Mar 2009 18:46:21 +0100 |
parents | f99a3b393c03 |
children | dbe4af57b240 |
line wrap: on
line diff
--- a/gen/llvmhelpers.cpp Wed Mar 25 13:46:49 2009 +0100 +++ b/gen/llvmhelpers.cpp Thu Mar 26 18:46:21 2009 +0100 @@ -248,14 +248,16 @@ target = lblstmt->enclosingScopeExit; // figure out up until what handler we need to emit - IRState::TargetScopeVec::reverse_iterator targetit; - for (targetit = gIR->targetScopes.rbegin(); targetit != gIR->targetScopes.rend(); ++targetit) { + IrFunction::TargetScopeVec::reverse_iterator targetit = gIR->func()->targetScopes.rbegin(); + IrFunction::TargetScopeVec::reverse_iterator it_end = gIR->func()->targetScopes.rend(); + while(targetit != it_end) { if (targetit->s == target) { break; } + ++targetit; } - if (target && targetit == gIR->targetScopes.rend()) { + if (target && targetit == it_end) { if (lblstmt) error(loc, "cannot goto into try, volatile or synchronized statement at %s", target->loc.toChars()); else @@ -270,10 +272,11 @@ // since the labelstatements possibly inside are private // and might already exist push a label scope gIR->func()->pushUniqueLabelScope("enclosing"); - IRState::TargetScopeVec::reverse_iterator it; - for (it = gIR->targetScopes.rbegin(); it != targetit; ++it) { + IrFunction::TargetScopeVec::reverse_iterator it = gIR->func()->targetScopes.rbegin(); + while (it != targetit) { if (it->enclosinghandler) it->enclosinghandler->emitCode(gIR); + ++it; } gIR->func()->popLabelScope(); }