diff options
author | Owen Anderson <resistor@mac.com> | 2009-07-22 00:24:57 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2009-07-22 00:24:57 +0000 |
commit | e922c0201916e0b980ab3cfe91e1413e68d55647 (patch) | |
tree | 663be741b84470d97945f01da459a3627af683fd /lib/CodeGen/IntrinsicLowering.cpp | |
parent | 7cf12c7efd37dc12c3ed536a3f4c373dddac2b85 (diff) | |
download | llvm-e922c0201916e0b980ab3cfe91e1413e68d55647.tar.gz |
Get rid of the Pass+Context magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 455adc44a1ee..34cbf2f9b2fe 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/lib/CodeGen/IntrinsicLowering.cpp @@ -320,7 +320,7 @@ static void ReplaceFPIntrinsicWithCall(CallInst *CI, const char *Fname, void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { IRBuilder<> Builder(CI->getParent(), CI); - LLVMContext *Context = CI->getParent()->getContext(); + LLVMContext &Context = CI->getContext(); Function *Callee = CI->getCalledFunction(); assert(Callee && "Cannot lower an indirect call!"); @@ -346,7 +346,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { } case Intrinsic::sigsetjmp: if (CI->getType() != Type::VoidTy) - CI->replaceAllUsesWith(Context->getNullValue(CI->getType())); + CI->replaceAllUsesWith(Context.getNullValue(CI->getType())); break; case Intrinsic::longjmp: { @@ -362,15 +362,15 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { break; } case Intrinsic::ctpop: - CI->replaceAllUsesWith(LowerCTPOP(*Context, CI->getOperand(1), CI)); + CI->replaceAllUsesWith(LowerCTPOP(Context, CI->getOperand(1), CI)); break; case Intrinsic::bswap: - CI->replaceAllUsesWith(LowerBSWAP(*Context, CI->getOperand(1), CI)); + CI->replaceAllUsesWith(LowerBSWAP(Context, CI->getOperand(1), CI)); break; case Intrinsic::ctlz: - CI->replaceAllUsesWith(LowerCTLZ(*Context, CI->getOperand(1), CI)); + CI->replaceAllUsesWith(LowerCTLZ(Context, CI->getOperand(1), CI)); break; case Intrinsic::cttz: { @@ -378,9 +378,9 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { Value *Src = CI->getOperand(1); Value *NotSrc = Builder.CreateNot(Src); NotSrc->setName(Src->getName() + ".not"); - Value *SrcM1 = Context->getConstantInt(Src->getType(), 1); + Value *SrcM1 = Context.getConstantInt(Src->getType(), 1); SrcM1 = Builder.CreateSub(Src, SrcM1); - Src = LowerCTPOP(*Context, Builder.CreateAnd(NotSrc, SrcM1), CI); + Src = LowerCTPOP(Context, Builder.CreateAnd(NotSrc, SrcM1), CI); CI->replaceAllUsesWith(Src); break; } @@ -393,7 +393,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { "save" : "restore") << " intrinsic.\n"; Warned = true; if (Callee->getIntrinsicID() == Intrinsic::stacksave) - CI->replaceAllUsesWith(Context->getNullValue(CI->getType())); + CI->replaceAllUsesWith(Context.getNullValue(CI->getType())); break; } @@ -414,7 +414,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::readcyclecounter: { cerr << "WARNING: this target does not support the llvm.readcyclecoun" << "ter intrinsic. It is being lowered to a constant 0\n"; - CI->replaceAllUsesWith(Context->getConstantInt(Type::Int64Ty, 0)); + CI->replaceAllUsesWith(Context.getConstantInt(Type::Int64Ty, 0)); break; } @@ -428,13 +428,13 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::eh_exception: case Intrinsic::eh_selector_i32: case Intrinsic::eh_selector_i64: - CI->replaceAllUsesWith(Context->getNullValue(CI->getType())); + CI->replaceAllUsesWith(Context.getNullValue(CI->getType())); break; case Intrinsic::eh_typeid_for_i32: case Intrinsic::eh_typeid_for_i64: // Return something different to eh_selector. - CI->replaceAllUsesWith(Context->getConstantInt(CI->getType(), 1)); + CI->replaceAllUsesWith(Context.getConstantInt(CI->getType(), 1)); break; case Intrinsic::var_annotation: @@ -506,7 +506,7 @@ void IntrinsicLowering::LowerIntrinsicCall(CallInst *CI) { case Intrinsic::flt_rounds: // Lower to "round to the nearest" if (CI->getType() != Type::VoidTy) - CI->replaceAllUsesWith(Context->getConstantInt(CI->getType(), 1)); + CI->replaceAllUsesWith(Context.getConstantInt(CI->getType(), 1)); break; } |