Mercurial > projects > ldc
diff gen/statements.cpp @ 1554:d6e8d5db259f
LLVMContext changes up to r77366
author | Benjamin Kramer <benny.kra@gmail.com> |
---|---|
date | Thu, 30 Jul 2009 15:25:10 +0200 |
parents | 327eef051d50 |
children | 1d5c3354b3c2 |
line wrap: on
line diff
--- a/gen/statements.cpp Thu Jul 23 20:34:35 2009 +0200 +++ b/gen/statements.cpp Thu Jul 30 15:25:10 2009 +0200 @@ -815,7 +815,7 @@ // build static array for ptr or final array const LLType* elemTy = DtoType(condition->type); const llvm::ArrayType* arrTy = llvm::ArrayType::get(elemTy, inits.size()); - LLConstant* arrInit = llvm::ConstantArray::get(arrTy, inits); + LLConstant* arrInit = LLConstantArray::get(arrTy, inits); llvm::GlobalVariable* arr = new llvm::GlobalVariable(*gIR->module, arrTy, true, llvm::GlobalValue::InternalLinkage, arrInit, ".string_switch_table_data"); const LLType* elemPtrTy = getPtrToType(elemTy); @@ -1030,7 +1030,7 @@ keyvar = DtoRawVarDeclaration(key); else keyvar = DtoRawAlloca(keytype, 0, "foreachkey"); // FIXME: align? - LLValue* zerokey = gIR->context().getConstantInt(keytype,0,false); + LLValue* zerokey = LLConstantInt::get(keytype,0,false); // value Logger::println("value = %s", value->toPrettyChars()); @@ -1087,7 +1087,7 @@ } else if (op == TOKforeach_reverse) { done = p->ir->CreateICmpUGT(load, zerokey, "tmp"); - load = p->ir->CreateSub(load, gIR->context().getConstantInt(keytype, 1, false), "tmp"); + load = p->ir->CreateSub(load, LLConstantInt::get(keytype, 1, false), "tmp"); DtoStore(load, keyvar); } llvm::BranchInst::Create(bodybb, endbb, done, p->scopebb()); @@ -1096,7 +1096,7 @@ p->scope() = IRScope(bodybb,nextbb); // get value for this iteration - LLConstant* zero = gIR->context().getConstantInt(keytype,0,false); + LLConstant* zero = LLConstantInt::get(keytype,0,false); LLValue* loadedKey = p->ir->CreateLoad(keyvar,"tmp"); LLValue* gep = DtoGEP1(val,loadedKey); @@ -1124,7 +1124,7 @@ p->scope() = IRScope(nextbb,endbb); if (op == TOKforeach) { LLValue* load = DtoLoad(keyvar); - load = p->ir->CreateAdd(load, gIR->context().getConstantInt(keytype, 1, false), "tmp"); + load = p->ir->CreateAdd(load, LLConstantInt::get(keytype, 1, false), "tmp"); DtoStore(load, keyvar); } llvm::BranchInst::Create(condbb, p->scopebb());