[opaque pointer type] Pass the explicit function type down to the instruction constru...
[oota-llvm.git] / lib / IR / Instructions.cpp
index 3e681380e9b31dfc60cca9316748e7f0795d150d..3a32be542cc3a0e65df6f1d91efe7e766346ac10 100644 (file)
@@ -537,9 +537,10 @@ Instruction* CallInst::CreateFree(Value* Source, BasicBlock *InsertAtEnd) {
 //                        InvokeInst Implementation
 //===----------------------------------------------------------------------===//
 
-void InvokeInst::init(Value *Fn, BasicBlock *IfNormal, BasicBlock *IfException,
-                      ArrayRef<Value *> Args, const Twine &NameStr) {
-  FTy = cast<FunctionType>(cast<PointerType>(Fn->getType())->getElementType());
+void InvokeInst::init(FunctionType *FTy, Value *Fn, BasicBlock *IfNormal,
+                      BasicBlock *IfException, ArrayRef<Value *> Args,
+                      const Twine &NameStr) {
+  this->FTy = FTy;
 
   assert(NumOperands == 3 + Args.size() && "NumOperands not set up?");
   Op<-3>() = Fn;