diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-06-18 20:05:31 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-06-18 20:05:31 +0000 |
commit | 82c7820deb56dc314953bd89f55de076b0f7a113 (patch) | |
tree | fc9a697a75b313734df5f3c087917edb85057587 /include/llvm/Support | |
parent | 7460b4a2e9e70c0cfa9f2360d5a24b9acfce4ff1 (diff) | |
download | external_llvm-82c7820deb56dc314953bd89f55de076b0f7a113.zip external_llvm-82c7820deb56dc314953bd89f55de076b0f7a113.tar.gz external_llvm-82c7820deb56dc314953bd89f55de076b0f7a113.tar.bz2 |
Revert IRBuilder CC propagation. Fix SimplifyLibCalls instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73715 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 47 |
1 files changed, 8 insertions, 39 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index acaf1f4..ed6a3f1 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -154,10 +154,8 @@ public: InvokeInst *CreateInvoke(Value *Callee, BasicBlock *NormalDest, BasicBlock *UnwindDest, InputIterator ArgBegin, InputIterator ArgEnd, const char *Name = "") { - return Insert(TransferAttributes(InvokeInst::Create(Callee, - NormalDest, UnwindDest, - ArgBegin, ArgEnd), - Callee), Name); + return Insert(InvokeInst::Create(Callee, NormalDest, UnwindDest, + ArgBegin, ArgEnd), Name); } UnwindInst *CreateUnwind() { @@ -589,61 +587,32 @@ public: return Insert(PHINode::Create(Ty), Name); } - CallInst *TransferAttributes(CallInst *CI, const Value* Callee) const { - if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Callee)) - Callee = GA->getAliasedGlobal(); - - if (const Function *F = dyn_cast<Function>(Callee)) { - CI->setCallingConv(F->getCallingConv()); - CI->setAttributes(F->getAttributes()); - } - - return CI; - } - - InvokeInst *TransferAttributes(InvokeInst *II, const Value* Callee) const { - if (const GlobalAlias *GA = dyn_cast<GlobalAlias>(Callee)) - Callee = GA->getAliasedGlobal(); - - if (const Function *F = dyn_cast<Function>(Callee)) { - II->setCallingConv(F->getCallingConv()); - II->setAttributes(F->getAttributes()); - } - - return II; - } - CallInst *CreateCall(Value *Callee, const char *Name = "") { - return Insert(TransferAttributes(CallInst::Create(Callee), Callee), Name); + return Insert(CallInst::Create(Callee), Name); } CallInst *CreateCall(Value *Callee, Value *Arg, const char *Name = "") { - return Insert(TransferAttributes(CallInst::Create(Callee, Arg), - Callee), Name); + return Insert(CallInst::Create(Callee, Arg), Name); } CallInst *CreateCall2(Value *Callee, Value *Arg1, Value *Arg2, const char *Name = "") { Value *Args[] = { Arg1, Arg2 }; - return Insert(TransferAttributes(CallInst::Create(Callee, Args, Args+2), - Callee), Name); + return Insert(CallInst::Create(Callee, Args, Args+2), Name); } CallInst *CreateCall3(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3, const char *Name = "") { Value *Args[] = { Arg1, Arg2, Arg3 }; - return Insert(TransferAttributes(CallInst::Create(Callee, Args, Args+3), - Callee), Name); + return Insert(CallInst::Create(Callee, Args, Args+3), Name); } CallInst *CreateCall4(Value *Callee, Value *Arg1, Value *Arg2, Value *Arg3, Value *Arg4, const char *Name = "") { Value *Args[] = { Arg1, Arg2, Arg3, Arg4 }; - return Insert(TransferAttributes(CallInst::Create(Callee, Args, Args+4), - Callee), Name); + return Insert(CallInst::Create(Callee, Args, Args+4), Name); } template<typename InputIterator> CallInst *CreateCall(Value *Callee, InputIterator ArgBegin, InputIterator ArgEnd, const char *Name = "") { - return Insert(TransferAttributes(CallInst::Create(Callee, ArgBegin, ArgEnd), - Callee), Name); + return Insert(CallInst::Create(Callee, ArgBegin, ArgEnd), Name); } Value *CreateSelect(Value *C, Value *True, Value *False, |