aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Support/IRBuilder.h
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2009-06-18 08:30:57 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2009-06-18 08:30:57 +0000
commite0f832988a079487586a8e087fa0ee3bccdb8fd7 (patch)
treedd5de351a383af8c100d2e03e3f650c2eb9d736b /include/llvm/Support/IRBuilder.h
parent41a6996ae24f30a5d6ecad5bc12d7dbb00b44c3d (diff)
downloadexternal_llvm-e0f832988a079487586a8e087fa0ee3bccdb8fd7.zip
external_llvm-e0f832988a079487586a8e087fa0ee3bccdb8fd7.tar.gz
external_llvm-e0f832988a079487586a8e087fa0ee3bccdb8fd7.tar.bz2
Forgot to commit this hunk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73693 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/IRBuilder.h')
-rw-r--r--include/llvm/Support/IRBuilder.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index 39aaebb..acaf1f4 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<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);
}