From: Anton Korobeynikov Date: Thu, 18 Jun 2009 08:30:57 +0000 (+0000) Subject: Forgot to commit this hunk X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fd0cfe4bb4782d2b525495dae5096d3709d888c6;p=oota-llvm.git Forgot to commit this hunk git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73693 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h index 39aaebbedd8..acaf1f4d010 100644 --- a/include/llvm/Support/IRBuilder.h +++ b/include/llvm/Support/IRBuilder.h @@ -601,6 +601,18 @@ public: return CI; } + InvokeInst *TransferAttributes(InvokeInst *II, const Value* Callee) const { + if (const GlobalAlias *GA = dyn_cast(Callee)) + Callee = GA->getAliasedGlobal(); + + if (const Function *F = dyn_cast(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); }