Mercurial > projects > ldc
comparison gen/asmstmt.cpp @ 309:d59c363fccad trunk
[svn r330] Implemented synchronized statements.
Changed the tryfinally handlers to a more generalized EnclosingHandler.
Changed ClassInfoS to be mutable so they can be used as locks.
Added new BB after throw ala return/break etc.
author | lindquist |
---|---|
date | Sat, 28 Jun 2008 11:37:53 +0200 |
parents | 2b72433d5c8c |
children | 553f844ae5b9 |
comparison
equal
deleted
inserted
replaced
308:6b62e8cdf970 | 309:d59c363fccad |
---|---|
379 ////////////////////////////////////////////////////////////////////////////// | 379 ////////////////////////////////////////////////////////////////////////////// |
380 | 380 |
381 AsmBlockStatement::AsmBlockStatement(Loc loc, Statements* s) | 381 AsmBlockStatement::AsmBlockStatement(Loc loc, Statements* s) |
382 : CompoundStatement(loc, s) | 382 : CompoundStatement(loc, s) |
383 { | 383 { |
384 enclosingtryfinally = NULL; | 384 enclosinghandler = NULL; |
385 } | 385 } |
386 | 386 |
387 // rewrite argument indices to the block scope indices | 387 // rewrite argument indices to the block scope indices |
388 static void remap_outargs(std::string& insnt, size_t nargs, size_t& idx) | 388 static void remap_outargs(std::string& insnt, size_t nargs, size_t& idx) |
389 { | 389 { |
636 { | 636 { |
637 llvm::BasicBlock* casebb = llvm::BasicBlock::Create("case", p->topfunc(), bb); | 637 llvm::BasicBlock* casebb = llvm::BasicBlock::Create("case", p->topfunc(), bb); |
638 sw->addCase(llvm::ConstantInt::get(llvm::IntegerType::get(32), it->first), casebb); | 638 sw->addCase(llvm::ConstantInt::get(llvm::IntegerType::get(32), it->first), casebb); |
639 | 639 |
640 p->scope() = IRScope(casebb,bb); | 640 p->scope() = IRScope(casebb,bb); |
641 DtoGoto(&loc, it->second, enclosingtryfinally); | 641 DtoGoto(&loc, it->second, enclosinghandler); |
642 } | 642 } |
643 | 643 |
644 p->scope() = IRScope(bb,oldend); | 644 p->scope() = IRScope(bb,oldend); |
645 } | 645 } |
646 } | 646 } |
667 } | 667 } |
668 | 668 |
669 // necessary for in-asm branches | 669 // necessary for in-asm branches |
670 Statement *AsmBlockStatement::semantic(Scope *sc) | 670 Statement *AsmBlockStatement::semantic(Scope *sc) |
671 { | 671 { |
672 enclosingtryfinally = sc->tfOfTry; | 672 enclosinghandler = sc->tfOfTry; |
673 | 673 |
674 return CompoundStatement::semantic(sc); | 674 return CompoundStatement::semantic(sc); |
675 } | 675 } |