diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-07-28 21:14:13 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-07-28 21:14:13 +0000 |
commit | 7379b6650008fba555d5472d5c76e8efc59e8a21 (patch) | |
tree | 7d817da4daae05b68a4da09bb3927cd7d8407702 /lib | |
parent | 6bd4842f89ef0f6a53b78664f9f3f2a1006117a9 (diff) | |
download | external_llvm-7379b6650008fba555d5472d5c76e8efc59e8a21.zip external_llvm-7379b6650008fba555d5472d5c76e8efc59e8a21.tar.gz external_llvm-7379b6650008fba555d5472d5c76e8efc59e8a21.tar.bz2 |
The personality function should be a Function* and not just a Value*.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136392 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/AsmParser/LLParser.cpp | 3 | ||||
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 3 | ||||
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp | 10 | ||||
-rw-r--r-- | lib/VMCore/Core.cpp | 3 | ||||
-rw-r--r-- | lib/VMCore/Instructions.cpp | 4 |
5 files changed, 14 insertions, 9 deletions
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp index b3f4d47..fe4bb2e 100644 --- a/lib/AsmParser/LLParser.cpp +++ b/lib/AsmParser/LLParser.cpp @@ -3547,7 +3547,8 @@ bool LLParser::ParseLandingPad(Instruction *&Inst, PerFunctionState &PFS) { } while (EatIfPresent(lltok::comma)); } - LandingPadInst *LP = LandingPadInst::Create(Ty, PersFn, Clauses.size()); + LandingPadInst *LP = LandingPadInst::Create(Ty, cast<Function>(PersFn), + Clauses.size()); LP->setCleanup(IsCleanup); for (SmallVectorImpl<std::pair<LandingPadInst::ClauseType, diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 4b83958..bab33ed 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -2539,7 +2539,8 @@ bool BitcodeReader::ParseFunctionBody(Function *F) { bool IsCleanup = !!Record[Idx++]; unsigned NumClauses = Record[Idx++]; - LandingPadInst *LP = LandingPadInst::Create(Ty, PersFn, NumClauses); + LandingPadInst *LP = LandingPadInst::Create(Ty, cast<Function>(PersFn), + NumClauses); LP->setCleanup(IsCleanup); for (unsigned J = 0; J != NumClauses; ++J) { LandingPadInst::ClauseType CT = diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp index 67707c6..c5c9790 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp @@ -914,10 +914,6 @@ void SelectionDAGBuilder::visitPHI(const PHINode &) { llvm_unreachable("SelectionDAGBuilder shouldn't visit PHI nodes!"); } -void SelectionDAGBuilder::visitLandingPad(const LandingPadInst &) { - // FIXME: Handle this -} - void SelectionDAGBuilder::visit(unsigned Opcode, const User &I) { // Note: this doesn't use InstVisitor, because it has to work with // ConstantExpr's in addition to instructions. @@ -1813,7 +1809,13 @@ void SelectionDAGBuilder::visitUnwind(const UnwindInst &I) { } void SelectionDAGBuilder::visitResume(const ResumeInst &RI) { + llvm_unreachable("SelectionDAGBuilder shouldn't visit resume instructions!"); +} + +void SelectionDAGBuilder::visitLandingPad(const LandingPadInst &) { // FIXME: Handle this + assert(FuncInfo.MBB->isLandingPad() && + "Call to landingpad not in landing pad!"); } /// handleSmallSwitchCaseRange - Emit a series of specific tests (suitable for diff --git a/lib/VMCore/Core.cpp b/lib/VMCore/Core.cpp index 5e93c73..318805b 100644 --- a/lib/VMCore/Core.cpp +++ b/lib/VMCore/Core.cpp @@ -1686,7 +1686,8 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef B, LLVMValueRef Fn, LLVMValueRef LLVMBuildLandingPad(LLVMBuilderRef B, LLVMTypeRef Ty, LLVMValueRef PersFn, unsigned NumClauses, const char *Name) { - return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), unwrap(PersFn), + return wrap(unwrap(B)->CreateLandingPad(unwrap(Ty), + cast<Function>(unwrap(PersFn)), NumClauses, Name)); } diff --git a/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp index c980a71..9fdff07 100644 --- a/lib/VMCore/Instructions.cpp +++ b/lib/VMCore/Instructions.cpp @@ -170,12 +170,12 @@ Value *PHINode::hasConstantValue() const { // LandingPadInst Implementation //===----------------------------------------------------------------------===// -void LandingPadInst::init(Value *PersFn, unsigned NumReservedValues, +void LandingPadInst::init(Function *PersFn, unsigned NumReservedValues, const Twine &NameStr) { ReservedSpace = NumReservedValues; NumOperands = 1; OperandList = allocHungoffUses(ReservedSpace); - OperandList[0] = PersFn; + OperandList[0] = (Value*)PersFn; setName(NameStr); } |