diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-14 23:10:40 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-14 23:10:40 +0000 |
commit | a1cf15f4680e5cf39e72e28c5ea854fcba792e84 (patch) | |
tree | d25822ba30525164abc1a3163d5cdd4a04a75f86 /lib/CodeGen/CGObjC.cpp | |
parent | b4aa4845b02c691b12e67731d05f42bceea786b1 (diff) |
Update for LLVM API change, and contextify a bunch of related stuff.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@75705 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGObjC.cpp')
-rw-r--r-- | lib/CodeGen/CGObjC.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index 4777bc77ea..7bed5bc572 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -28,7 +28,7 @@ llvm::Value *CodeGenFunction::EmitObjCStringLiteral(const ObjCStringLiteral *E) { llvm::Constant *C = CGM.getObjCRuntime().GenerateConstantString(E); // FIXME: This bitcast should just be made an invariant on the Runtime. - return llvm::ConstantExpr::getBitCast(C, ConvertType(E->getType())); + return VMContext.getConstantExprBitCast(C, ConvertType(E->getType())); } /// Emit a selector. @@ -179,7 +179,7 @@ void CodeGenFunction::GenerateObjCGetter(ObjCImplementationDecl *IMP, Builder.CreateBitCast(LoadObjCSelf(), Types.ConvertType(IdTy)); llvm::Value *Offset = EmitIvarOffset(IMP->getClassInterface(), Ivar); llvm::Value *True = - llvm::ConstantInt::get(Types.ConvertType(getContext().BoolTy), 1); + VMContext.getConstantInt(Types.ConvertType(getContext().BoolTy), 1); CallArgList Args; Args.push_back(std::make_pair(RValue::get(SelfAsId), IdTy)); Args.push_back(std::make_pair(RValue::get(CmdVal), Cmd->getType())); @@ -262,9 +262,9 @@ void CodeGenFunction::GenerateObjCSetter(ObjCImplementationDecl *IMP, Builder.CreateBitCast(Builder.CreateLoad(Arg, "arg"), Types.ConvertType(IdTy)); llvm::Value *True = - llvm::ConstantInt::get(Types.ConvertType(getContext().BoolTy), 1); + VMContext.getConstantInt(Types.ConvertType(getContext().BoolTy), 1); llvm::Value *False = - llvm::ConstantInt::get(Types.ConvertType(getContext().BoolTy), 0); + VMContext.getConstantInt(Types.ConvertType(getContext().BoolTy), 0); CallArgList Args; Args.push_back(std::make_pair(RValue::get(SelfAsId), IdTy)); Args.push_back(std::make_pair(RValue::get(CmdVal), Cmd->getType())); @@ -471,7 +471,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ getContext().getPointerType(ItemsTy))); const llvm::Type *UnsignedLongLTy = ConvertType(getContext().UnsignedLongTy); - llvm::Constant *Count = llvm::ConstantInt::get(UnsignedLongLTy, NumItems); + llvm::Constant *Count = VMContext.getConstantInt(UnsignedLongLTy, NumItems); Args.push_back(std::make_pair(RValue::get(Count), getContext().UnsignedLongTy)); @@ -488,7 +488,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ llvm::BasicBlock *SetStartMutations = createBasicBlock("setstartmutations"); llvm::Value *Limit = Builder.CreateLoad(LimitPtr); - llvm::Value *Zero = getLLVMContext().getNullValue(UnsignedLongLTy); + llvm::Value *Zero = VMContext.getNullValue(UnsignedLongLTy); llvm::Value *IsZero = Builder.CreateICmpEQ(Limit, Zero, "iszero"); Builder.CreateCondBr(IsZero, NoElements, SetStartMutations); @@ -574,7 +574,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ // Increment the counter. Counter = Builder.CreateAdd(Counter, - llvm::ConstantInt::get(UnsignedLongLTy, 1)); + VMContext.getConstantInt(UnsignedLongLTy, 1)); Builder.CreateStore(Counter, CounterPtr); llvm::BasicBlock *LoopEnd = createBasicBlock("loopend"); @@ -618,7 +618,7 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ LValue LV = EmitLValue(cast<Expr>(S.getElement())); // Set the value to null. - Builder.CreateStore(getLLVMContext().getNullValue(ConvertType(ElementTy)), + Builder.CreateStore(VMContext.getNullValue(ConvertType(ElementTy)), LV.getAddress()); } |