comparison gen/llvmhelpers.cpp @ 304:3ebc136702dd trunk

[svn r325] Removed dead code. Added license info to code from GDC (David Friedman permitted us to use the files under the Artistic License). Added asmLabel check to DtoGoto to avoid jumping into inline asm. Doesn't work currently as LabelDsymbol::asmLabel is never set to true.
author ChristianK
date Wed, 25 Jun 2008 23:42:38 +0200
parents bef811104734
children 2b72433d5c8c
comparison
equal deleted inserted replaced
303:4aa2b6753059 304:3ebc136702dd
155 // GOTO HELPER 155 // GOTO HELPER
156 ////////////////////////////////////////////////////////////////////////////////////////*/ 156 ////////////////////////////////////////////////////////////////////////////////////////*/
157 void DtoGoto(Loc* loc, LabelDsymbol* target, TryFinallyStatement* enclosingtryfinally) 157 void DtoGoto(Loc* loc, LabelDsymbol* target, TryFinallyStatement* enclosingtryfinally)
158 { 158 {
159 assert(!gIR->scopereturned()); 159 assert(!gIR->scopereturned());
160
161 // if the target label is inside inline asm, error
162 if(target->asmLabel)
163 error("cannot goto into inline asm block", loc->toChars());
160 164
161 if (target->statement->llvmBB == NULL) 165 if (target->statement->llvmBB == NULL)
162 target->statement->llvmBB = llvm::BasicBlock::Create("label", gIR->topfunc()); 166 target->statement->llvmBB = llvm::BasicBlock::Create("label", gIR->topfunc());
163 167
164 // find finallys between goto and label 168 // find finallys between goto and label