[llvm-commits] [llvm] r136326 - in /llvm/trunk: include/llvm/Instructions.h lib/AsmParser/LLParser.cpp lib/Bitcode/Reader/BitcodeReader.cpp lib/VMCore/Core.cpp lib/VMCore/Instructions.cpp
Bill Wendling
isanbard at gmail.com
Wed Jul 27 19:27:12 PDT 2011
Author: void
Date: Wed Jul 27 21:27:12 2011
New Revision: 136326
URL: http://llvm.org/viewvc/llvm-project?rev=136326&view=rev
Log:
Make sure that the landingpad instruction takes a Constant* as the clause's value.
Modified:
llvm/trunk/include/llvm/Instructions.h
llvm/trunk/lib/AsmParser/LLParser.cpp
llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
llvm/trunk/lib/VMCore/Core.cpp
llvm/trunk/lib/VMCore/Instructions.cpp
Modified: llvm/trunk/include/llvm/Instructions.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Instructions.h?rev=136326&r1=136325&r2=136326&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Instructions.h (original)
+++ llvm/trunk/include/llvm/Instructions.h Wed Jul 27 21:27:12 2011
@@ -1852,7 +1852,7 @@
void setCleanup(bool Val) { IsCleanup = Val; }
/// addClause - Add a clause to the landing pad.
- void addClause(ClauseType CT, Value *ClauseVal);
+ void addClause(ClauseType CT, Constant *ClauseVal);
/// getClauseType - Return the type of the clause at this index. The two
/// supported clauses are Catch and Filter.
@@ -1862,9 +1862,9 @@
}
/// getClauseValue - Return the value of the clause at this index.
- Value *getClauseValue(unsigned I) const {
+ Constant *getClauseValue(unsigned I) const {
assert(I + 1 < getNumOperands() && "Index too large!");
- return OperandList[I + 1];
+ return cast<Constant>(OperandList[I + 1]);
}
/// getNumClauses - Get the number of clauses for this landing pad.
Modified: llvm/trunk/lib/AsmParser/LLParser.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/AsmParser/LLParser.cpp?rev=136326&r1=136325&r2=136326&view=diff
==============================================================================
--- llvm/trunk/lib/AsmParser/LLParser.cpp (original)
+++ llvm/trunk/lib/AsmParser/LLParser.cpp Wed Jul 27 21:27:12 2011
@@ -3528,7 +3528,7 @@
bool IsCleanup = EatIfPresent(lltok::kw_cleanup);
- SmallVector<std::pair<LandingPadInst::ClauseType, Value*>, 16> Clauses;
+ SmallVector<std::pair<LandingPadInst::ClauseType, Constant*>, 16> Clauses;
while (Lex.getKind() == lltok::kw_catch || Lex.getKind() == lltok::kw_filter){
LandingPadInst::ClauseType CT;
if (Lex.getKind() == lltok::kw_catch) {
@@ -3543,14 +3543,15 @@
Value *V; LocTy VLoc;
if (ParseTypeAndValue(V, VLoc, PFS))
return true;
- Clauses.push_back(std::make_pair(CT, V));
+ Clauses.push_back(std::make_pair(CT, cast<Constant>(V)));
} while (EatIfPresent(lltok::comma));
}
LandingPadInst *LP = LandingPadInst::Create(Ty, PersFn, Clauses.size());
LP->setCleanup(IsCleanup);
- for (SmallVectorImpl<std::pair<LandingPadInst::ClauseType, Value*> >::iterator
+ for (SmallVectorImpl<std::pair<LandingPadInst::ClauseType,
+ Constant*> >::iterator
I = Clauses.begin(), E = Clauses.end(); I != E; ++I)
LP->addClause(I->first, I->second);
Modified: llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp?rev=136326&r1=136325&r2=136326&view=diff
==============================================================================
--- llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp (original)
+++ llvm/trunk/lib/Bitcode/Reader/BitcodeReader.cpp Wed Jul 27 21:27:12 2011
@@ -2550,7 +2550,7 @@
return Error("Invalid LANDINGPAD record");
}
- LP->addClause(CT, Val);
+ LP->addClause(CT, cast<Constant>(Val));
}
I = LP;
Modified: llvm/trunk/lib/VMCore/Core.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Core.cpp?rev=136326&r1=136325&r2=136326&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Core.cpp (original)
+++ llvm/trunk/lib/VMCore/Core.cpp Wed Jul 27 21:27:12 2011
@@ -1715,7 +1715,7 @@
LLVMValueRef ClauseVal) {
unwrap<LandingPadInst>(LandingPad)->
addClause(static_cast<LandingPadInst::ClauseType>(ClauseTy),
- unwrap(ClauseVal));
+ cast<Constant>(unwrap(ClauseVal)));
}
void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val) {
Modified: llvm/trunk/lib/VMCore/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/VMCore/Instructions.cpp?rev=136326&r1=136325&r2=136326&view=diff
==============================================================================
--- llvm/trunk/lib/VMCore/Instructions.cpp (original)
+++ llvm/trunk/lib/VMCore/Instructions.cpp Wed Jul 27 21:27:12 2011
@@ -228,14 +228,14 @@
Use::zap(OldOps, OldOps + e, true);
}
-void LandingPadInst::addClause(ClauseType CT, Value *ClauseVal) {
+void LandingPadInst::addClause(ClauseType CT, Constant *ClauseVal) {
unsigned OpNo = getNumOperands();
if (OpNo + 1 > ReservedSpace)
growOperands();
assert(OpNo < ReservedSpace && "Growing didn't work!");
ClauseIdxs.push_back(CT);
++NumOperands;
- OperandList[OpNo] = ClauseVal;
+ OperandList[OpNo] = (Value*)ClauseVal;
}
//===----------------------------------------------------------------------===//
More information about the llvm-commits
mailing list