diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2009-06-18 08:30:57 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2009-06-18 08:30:57 +0000 |
commit | e2ff9a6f380dc74af018983de29787338450c72a (patch) | |
tree | 68d32d310d3bd34e3740e0192e1db4df8ceb2aa7 | |
parent | 832b9e6a7a34da0c192be3e6ce70cc62fed1e067 (diff) | |
download | bcm5719-llvm-e2ff9a6f380dc74af018983de29787338450c72a.tar.gz bcm5719-llvm-e2ff9a6f380dc74af018983de29787338450c72a.zip |
Forgot to commit this hunk
llvm-svn: 73693
-rw-r--r-- | llvm/include/llvm/Support/IRBuilder.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Support/IRBuilder.h b/llvm/include/llvm/Support/IRBuilder.h index 39aaebbedd8..acaf1f4d010 100644 --- a/llvm/include/llvm/Support/IRBuilder.h +++ b/llvm/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<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); } |