[llvm-commits] [llvm] r73693 - /llvm/trunk/include/llvm/Support/IRBuilder.h
Anton Korobeynikov
asl at math.spbu.ru
Thu Jun 18 01:30:58 PDT 2009
Author: asl
Date: Thu Jun 18 03:30:57 2009
New Revision: 73693
URL: http://llvm.org/viewvc/llvm-project?rev=73693&view=rev
Log:
Forgot to commit this hunk
Modified:
llvm/trunk/include/llvm/Support/IRBuilder.h
Modified: llvm/trunk/include/llvm/Support/IRBuilder.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/IRBuilder.h?rev=73693&r1=73692&r2=73693&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/IRBuilder.h (original)
+++ llvm/trunk/include/llvm/Support/IRBuilder.h Thu Jun 18 03:30:57 2009
@@ -601,6 +601,18 @@
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);
}
More information about the llvm-commits
mailing list