comparison gen/statements.cpp @ 298:3b8ada4c9f8b trunk

[svn r319] Call substatement->toIR in LabelStatement::toIR even when the label is inside an asm block.
author ChristianK
date Tue, 24 Jun 2008 17:24:55 +0200
parents 1e6e2b5d5bfe
children df8a7b8d5929
comparison
equal deleted inserted replaced
297:5de180867c46 298:3b8ada4c9f8b
1068 IRAsmStmt* a = new IRAsmStmt; 1068 IRAsmStmt* a = new IRAsmStmt;
1069 a->code = ".LDASM_"; 1069 a->code = ".LDASM_";
1070 a->code += ident->toChars(); 1070 a->code += ident->toChars();
1071 a->code += ":"; 1071 a->code += ":";
1072 p->asmBlock->s.push_back(a); 1072 p->asmBlock->s.push_back(a);
1073 return; 1073 }
1074 }
1075
1076 assert(tf == NULL);
1077
1078 llvm::BasicBlock* oldend = gIR->scopeend();
1079 if (llvmBB)
1080 llvmBB->moveBefore(oldend);
1081 else 1074 else
1082 llvmBB = llvm::BasicBlock::Create("label", p->topfunc(), oldend); 1075 {
1083 1076
1084 if (!p->scopereturned()) 1077 assert(tf == NULL);
1085 llvm::BranchInst::Create(llvmBB, p->scopebb()); 1078
1086 1079 llvm::BasicBlock* oldend = gIR->scopeend();
1087 p->scope() = IRScope(llvmBB,oldend); 1080 if (llvmBB)
1081 llvmBB->moveBefore(oldend);
1082 else
1083 llvmBB = llvm::BasicBlock::Create("label", p->topfunc(), oldend);
1084
1085 if (!p->scopereturned())
1086 llvm::BranchInst::Create(llvmBB, p->scopebb());
1087
1088 p->scope() = IRScope(llvmBB,oldend);
1089 }
1090
1088 if (statement) 1091 if (statement)
1089 statement->toIR(p); 1092 statement->toIR(p);
1090 } 1093 }
1091 1094
1092 ////////////////////////////////////////////////////////////////////////////// 1095 //////////////////////////////////////////////////////////////////////////////