Mercurial > projects > ldc
comparison gen/asmstmt.cpp @ 356:44daf304421c trunk
[svn r377] The previous check was too strict, it completely disallowed gotos within finally blocks. This reenables them as long as they don't cross a finally boundary.
author | ChristianK |
---|---|
date | Mon, 14 Jul 2008 12:00:24 +0200 |
parents | aaade6ded589 |
children | 672eb4893b55 |
comparison
equal
deleted
inserted
replaced
355:d8357f7004ca | 356:44daf304421c |
---|---|
386 | 386 |
387 AsmBlockStatement::AsmBlockStatement(Loc loc, Statements* s) | 387 AsmBlockStatement::AsmBlockStatement(Loc loc, Statements* s) |
388 : CompoundStatement(loc, s) | 388 : CompoundStatement(loc, s) |
389 { | 389 { |
390 enclosinghandler = NULL; | 390 enclosinghandler = NULL; |
391 tf = NULL; | |
391 } | 392 } |
392 | 393 |
393 // rewrite argument indices to the block scope indices | 394 // rewrite argument indices to the block scope indices |
394 static void remap_outargs(std::string& insnt, size_t nargs, size_t& idx) | 395 static void remap_outargs(std::string& insnt, size_t nargs, size_t& idx) |
395 { | 396 { |
646 { | 647 { |
647 llvm::BasicBlock* casebb = llvm::BasicBlock::Create("case", p->topfunc(), bb); | 648 llvm::BasicBlock* casebb = llvm::BasicBlock::Create("case", p->topfunc(), bb); |
648 sw->addCase(llvm::ConstantInt::get(llvm::IntegerType::get(32), it->second), casebb); | 649 sw->addCase(llvm::ConstantInt::get(llvm::IntegerType::get(32), it->second), casebb); |
649 | 650 |
650 p->scope() = IRScope(casebb,bb); | 651 p->scope() = IRScope(casebb,bb); |
651 DtoGoto(&loc, it->first, enclosinghandler); | 652 DtoGoto(&loc, it->first, enclosinghandler, tf); |
652 } | 653 } |
653 | 654 |
654 p->scope() = IRScope(bb,oldend); | 655 p->scope() = IRScope(bb,oldend); |
655 } | 656 } |
656 } | 657 } |
678 | 679 |
679 // necessary for in-asm branches | 680 // necessary for in-asm branches |
680 Statement *AsmBlockStatement::semantic(Scope *sc) | 681 Statement *AsmBlockStatement::semantic(Scope *sc) |
681 { | 682 { |
682 enclosinghandler = sc->tfOfTry; | 683 enclosinghandler = sc->tfOfTry; |
684 tf = sc->tf; | |
683 | 685 |
684 return CompoundStatement::semantic(sc); | 686 return CompoundStatement::semantic(sc); |
685 } | 687 } |