OSDN Git Service

Forgot to commit this hunk
authorAnton Korobeynikov <asl@math.spbu.ru>
Thu, 18 Jun 2009 08:30:57 +0000 (08:30 +0000)
committerAnton Korobeynikov <asl@math.spbu.ru>
Thu, 18 Jun 2009 08:30:57 +0000 (08:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73693 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/IRBuilder.h

index 39aaebb..acaf1f4 100644 (file)
@@ -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);
   }