summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2015-05-13 18:35:26 +0000
committerDavid Blaikie <dblaikie@gmail.com>2015-05-13 18:35:26 +0000
commit3e80709ef9cedf04f5001d02b26921c9f0d43d5d (patch)
tree31da746b40fe298eea6d93df960258e6bd6633f6 /llvm/lib
parent1ce4ebf7d6fe923249d3cc5ef0840ad3bbe93845 (diff)
downloadbcm5719-llvm-3e80709ef9cedf04f5001d02b26921c9f0d43d5d.tar.gz
bcm5719-llvm-3e80709ef9cedf04f5001d02b26921c9f0d43d5d.zip
[opaque pointer type] Pass the explicit function type down to the instruction constructor when parsing invoke instructions
llvm-svn: 237273
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/AsmParser/LLParser.cpp2
-rw-r--r--llvm/lib/IR/Instructions.cpp7
2 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/AsmParser/LLParser.cpp b/llvm/lib/AsmParser/LLParser.cpp
index e69fa3828ed..398292c2aa1 100644
--- a/llvm/lib/AsmParser/LLParser.cpp
+++ b/llvm/lib/AsmParser/LLParser.cpp
@@ -4826,7 +4826,7 @@ bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
// Finish off the Attribute and check them
AttributeSet PAL = AttributeSet::get(Context, Attrs);
- InvokeInst *II = InvokeInst::Create(Callee, NormalBB, UnwindBB, Args);
+ InvokeInst *II = InvokeInst::Create(Ty, Callee, NormalBB, UnwindBB, Args);
II->setCallingConv(CC);
II->setAttributes(PAL);
ForwardRefAttrGroups[II] = FwdRefAttrGrps;
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 3e681380e9b..3a32be542cc 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -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;
OpenPOWER on IntegriCloud