aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-07-30 05:42:50 +0000
committerBill Wendling <isanbard@gmail.com>2011-07-30 05:42:50 +0000
commit10c6d12a9fd4dab411091f64db4db69670b88850 (patch)
tree629a8bff765bcf0baa378c7367ab1d903f3910fc
parentefd7919618d59bd0e3fcf861cc0d1eacbbed0ac6 (diff)
Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--docs/LangRef.html35
-rw-r--r--include/llvm-c/Core.h21
-rw-r--r--include/llvm/Bitcode/LLVMBitCodes.h8
-rw-r--r--include/llvm/CodeGen/FunctionLoweringInfo.h5
-rw-r--r--include/llvm/Instruction.def123
-rw-r--r--include/llvm/Instructions.h173
-rw-r--r--include/llvm/Support/IRBuilder.h9
-rw-r--r--include/llvm/Support/InstVisitor.h2
-rw-r--r--lib/AsmParser/LLLexer.cpp8
-rw-r--r--lib/AsmParser/LLParser.cpp65
-rw-r--r--lib/AsmParser/LLParser.h2
-rw-r--r--lib/AsmParser/LLToken.h8
-rw-r--r--lib/Bitcode/Reader/BitcodeReader.cpp40
-rw-r--r--lib/Bitcode/Writer/BitcodeWriter.cpp18
-rw-r--r--lib/CodeGen/DwarfEHPrepare.cpp58
-rw-r--r--lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp34
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp44
-rw-r--r--lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h2
-rw-r--r--lib/CodeGen/ShadowStackGC.cpp6
-rw-r--r--lib/Target/CBackend/CBackend.cpp4
-rw-r--r--lib/Target/CppBackend/CPPBackend.cpp8
-rw-r--r--lib/Transforms/IPO/GlobalOpt.cpp2
-rw-r--r--lib/Transforms/InstCombine/InstCombineCalls.cpp8
-rw-r--r--lib/Transforms/Scalar/SCCP.cpp2
-rw-r--r--lib/Transforms/Utils/InlineFunction.cpp161
-rw-r--r--lib/VMCore/AsmWriter.cpp30
-rw-r--r--lib/VMCore/Core.cpp23
-rw-r--r--lib/VMCore/Instruction.cpp2
-rw-r--r--lib/VMCore/Instructions.cpp122
-rw-r--r--lib/VMCore/Verifier.cpp69
-rw-r--r--test/Feature/exceptionhandling.ll54
31 files changed, 111 insertions, 1035 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html
index 0c07f12ecf..6c36ea1870 100644
--- a/docs/LangRef.html
+++ b/docs/LangRef.html
@@ -124,7 +124,6 @@
<li><a href="#i_indirectbr">'<tt>indirectbr</tt>' Instruction</a></li>
<li><a href="#i_invoke">'<tt>invoke</tt>' Instruction</a></li>
<li><a href="#i_unwind">'<tt>unwind</tt>' Instruction</a></li>
- <li><a href="#i_resume">'<tt>resume</tt>' Instruction</a></li>
<li><a href="#i_unreachable">'<tt>unreachable</tt>' Instruction</a></li>
</ol>
</li>
@@ -3024,14 +3023,13 @@ should not be exposed to source languages.</p>
control flow, not values (the one exception being the
'<a href="#i_invoke"><tt>invoke</tt></a>' instruction).</p>
-<p>There are eight different terminator instructions: the
+<p>There are seven different terminator instructions: the
'<a href="#i_ret"><tt>ret</tt></a>' instruction, the
'<a href="#i_br"><tt>br</tt></a>' instruction, the
'<a href="#i_switch"><tt>switch</tt></a>' instruction, the
'<a href="#i_indirectbr">'<tt>indirectbr</tt></a>' Instruction, the
'<a href="#i_invoke"><tt>invoke</tt></a>' instruction, the
- '<a href="#i_unwind"><tt>unwind</tt></a>' instruction, the
- '<a href="#i_resume"><tt>resume</tt></a>' instruction, and the
+ '<a href="#i_unwind"><tt>unwind</tt></a>' instruction, and the
'<a href="#i_unreachable"><tt>unreachable</tt></a>' instruction.</p>
<!-- _______________________________________________________________________ -->
@@ -3355,35 +3353,6 @@ that the invoke/unwind semantics are likely to change in future versions.</p>
<!-- _______________________________________________________________________ -->
<h4>
- <a name="i_resume">'<tt>resume</tt>' Instruction</a>
-</h4>
-
-<div>
-
-<h5>Syntax:</h5>
-<pre>
- resume &lt;type&gt; &lt;value&gt;
-</pre>
-
-<h5>Overview:</h5>
-<p>The '<tt>resume</tt>' instruction is a terminator instruction that has no
- successors. Its operand must have the same type as the result of any
- '<tt>landingpad</tt>' instruction in the same function.</p>
-
-<h5>Semantics:</h5>
-<p>The '<tt>resume</tt>' instruction resumes propagation of an existing
- (in-flight) exception.</p>
-
-<h5>Example:</h5>
-<pre>
- resume { i8*, i32 } %exn
-</pre>
-
-</div>
-
-<!-- _______________________________________________________________________ -->
-
-<h4>
<a name="i_unreachable">'<tt>unreachable</tt>' Instruction</a>
</h4>
diff --git a/include/llvm-c/Core.h b/include/llvm-c/Core.h
index 69996074f2..51da66231d 100644
--- a/include/llvm-c/Core.h
+++ b/include/llvm-c/Core.h
@@ -188,11 +188,7 @@ typedef enum {
/* Atomic operators */
LLVMFence = 55,
LLVMAtomicCmpXchg = 56,
- LLVMAtomicRMW = 57,
-
- /* Exception Handling Operators */
- LLVMLandingPad = 58,
- LLVMResume = 59
+ LLVMAtomicRMW = 57
} LLVMOpcode;
@@ -284,11 +280,6 @@ typedef enum {
LLVMRealPredicateTrue /**< Always true (always folded) */
} LLVMRealPredicate;
-typedef enum {
- LLVMCatch, /**< A catch clause */
- LLVMFilter /**< A filter clause */
-} LLVMLandingPadClauseTy;
-
void LLVMInitializeCore(LLVMPassRegistryRef R);
@@ -475,7 +466,6 @@ LLVMTypeRef LLVMX86MMXType(void);
macro(GetElementPtrInst) \
macro(InsertElementInst) \
macro(InsertValueInst) \
- macro(LandingPadInst) \
macro(PHINode) \
macro(SelectInst) \
macro(ShuffleVectorInst) \
@@ -487,7 +477,6 @@ LLVMTypeRef LLVMX86MMXType(void);
macro(SwitchInst) \
macro(UnreachableInst) \
macro(UnwindInst) \
- macro(ResumeInst) \
macro(UnaryInstruction) \
macro(AllocaInst) \
macro(CastInst) \
@@ -836,7 +825,6 @@ LLVMValueRef LLVMBuildInvoke(LLVMBuilderRef, LLVMValueRef Fn,
LLVMBasicBlockRef Then, LLVMBasicBlockRef Catch,
const char *Name);
LLVMValueRef LLVMBuildUnwind(LLVMBuilderRef);
-LLVMValueRef LLVMBuildResume(LLVMBuilderRef B, LLVMValueRef Exn);
LLVMValueRef LLVMBuildUnreachable(LLVMBuilderRef);
/* Add a case to the switch instruction */
@@ -846,13 +834,6 @@ void LLVMAddCase(LLVMValueRef Switch, LLVMValueRef OnVal,
/* Add a destination to the indirectbr instruction */
void LLVMAddDestination(LLVMValueRef IndirectBr, LLVMBasicBlockRef Dest);
-/* Add a clause to the landingpad instruction */
-void LLVMAddClause(LLVMValueRef LandingPad, LLVMLandingPadClauseTy ClauseTy,
- LLVMValueRef ClauseVal);
-
-/* Set the 'cleanup' flag in the landingpad instruction */
-void LLVMSetCleanup(LLVMValueRef LandingPad, LLVMBool Val);
-
/* Arithmetic */
LLVMValueRef LLVMBuildAdd(LLVMBuilderRef, LLVMValueRef LHS, LLVMValueRef RHS,
const char *Name);
diff --git a/include/llvm/Bitcode/LLVMBitCodes.h b/include/llvm/Bitcode/LLVMBitCodes.h
index 71512166d4..404e3dea49 100644
--- a/include/llvm/Bitcode/LLVMBitCodes.h
+++ b/include/llvm/Bitcode/LLVMBitCodes.h
@@ -274,7 +274,7 @@ namespace bitc {
FUNC_CODE_INST_UNREACHABLE = 15, // UNREACHABLE
FUNC_CODE_INST_PHI = 16, // PHI: [ty, val0,bb0, ...]
- FUNC_CODE_INST_RESUME = 17, // RESUME: [opval]
+ // 17 is unused.
// 18 is unused.
FUNC_CODE_INST_ALLOCA = 19, // ALLOCA: [instty, op, align]
FUNC_CODE_INST_LOAD = 20, // LOAD: [opty, op, align, vol]
@@ -302,13 +302,11 @@ namespace bitc {
FUNC_CODE_DEBUG_LOC = 35, // DEBUG_LOC: [Line,Col,ScopeVal, IAVal]
FUNC_CODE_INST_FENCE = 36, // FENCE: [ordering, synchscope]
- FUNC_CODE_INST_LANDINGPAD = 37, // LANDINGPAD: [ty,val,val,num,id0,val0...]
- FUNC_CODE_INST_CMPXCHG = 38, // CMPXCHG: [ptrty,ptr,cmp,new, align, vol,
+ FUNC_CODE_INST_CMPXCHG = 37, // CMPXCHG: [ptrty,ptr,cmp,new, align, vol,
// ordering, synchscope]
- FUNC_CODE_INST_ATOMICRMW = 39 // ATOMICRMW: [ptrty,ptr,val, operation,
+ FUNC_CODE_INST_ATOMICRMW = 38 // ATOMICRMW: [ptrty,ptr,val, operation,
// align, vol,
// ordering, synchscope]
-
};
} // End bitc namespace
} // End llvm namespace
diff --git a/include/llvm/CodeGen/FunctionLoweringInfo.h b/include/llvm/CodeGen/FunctionLoweringInfo.h
index 280481b25a..7eb21b5c66 100644
--- a/include/llvm/CodeGen/FunctionLoweringInfo.h
+++ b/include/llvm/CodeGen/FunctionLoweringInfo.h
@@ -220,11 +220,6 @@ void AddCatchInfo(const CallInst &I,
void CopyCatchInfo(const BasicBlock *SuccBB, const BasicBlock *LPad,
MachineModuleInfo *MMI, FunctionLoweringInfo &FLI);
-/// AddLandingPadInfo - Extract the exception handling information from the
-/// landingpad instruction and add them to the specified machine module info.
-void AddLandingPadInfo(const LandingPadInst &I, MachineModuleInfo &MMI,
- MachineBasicBlock *MBB);
-
} // end namespace llvm
#endif
diff --git a/include/llvm/Instruction.def b/include/llvm/Instruction.def
index d36e4be1d9..b2c7d63eba 100644
--- a/include/llvm/Instruction.def
+++ b/include/llvm/Instruction.def
@@ -100,80 +100,79 @@ HANDLE_TERM_INST ( 3, Switch , SwitchInst)
HANDLE_TERM_INST ( 4, IndirectBr , IndirectBrInst)
HANDLE_TERM_INST ( 5, Invoke , InvokeInst)
HANDLE_TERM_INST ( 6, Unwind , UnwindInst)
-HANDLE_TERM_INST ( 7, Resume , ResumeInst)
-HANDLE_TERM_INST ( 8, Unreachable, UnreachableInst)
- LAST_TERM_INST ( 8)
+HANDLE_TERM_INST ( 7, Unreachable, UnreachableInst)
+ LAST_TERM_INST ( 7)
// Standard binary operators...
- FIRST_BINARY_INST( 9)
-HANDLE_BINARY_INST( 9, Add , BinaryOperator)
-HANDLE_BINARY_INST(10, FAdd , BinaryOperator)
-HANDLE_BINARY_INST(11, Sub , BinaryOperator)
-HANDLE_BINARY_INST(12, FSub , BinaryOperator)
-HANDLE_BINARY_INST(13, Mul , BinaryOperator)
-HANDLE_BINARY_INST(14, FMul , BinaryOperator)
-HANDLE_BINARY_INST(15, UDiv , BinaryOperator)
-HANDLE_BINARY_INST(16, SDiv , BinaryOperator)
-HANDLE_BINARY_INST(17, FDiv , BinaryOperator)
-HANDLE_BINARY_INST(18, URem , BinaryOperator)
-HANDLE_BINARY_INST(19, SRem , BinaryOperator)
-HANDLE_BINARY_INST(20, FRem , BinaryOperator)
+ FIRST_BINARY_INST( 8)
+HANDLE_BINARY_INST( 8, Add , BinaryOperator)
+HANDLE_BINARY_INST( 9, FAdd , BinaryOperator)
+HANDLE_BINARY_INST(10, Sub , BinaryOperator)
+HANDLE_BINARY_INST(11, FSub , BinaryOperator)
+HANDLE_BINARY_INST(12, Mul , BinaryOperator)
+HANDLE_BINARY_INST(13, FMul , BinaryOperator)
+HANDLE_BINARY_INST(14, UDiv , BinaryOperator)
+HANDLE_BINARY_INST(15, SDiv , BinaryOperator)
+HANDLE_BINARY_INST(16, FDiv , BinaryOperator)
+HANDLE_BINARY_INST(17, URem , BinaryOperator)
+HANDLE_BINARY_INST(18, SRem , BinaryOperator)
+HANDLE_BINARY_INST(19, FRem , BinaryOperator)
// Logical operators (integer operands)
-HANDLE_BINARY_INST(21, Shl , BinaryOperator) // Shift left (logical)
-HANDLE_BINARY_INST(22, LShr , BinaryOperator) // Shift right (logical)
-HANDLE_BINARY_INST(23, AShr , BinaryOperator) // Shift right (arithmetic)
-HANDLE_BINARY_INST(24, And , BinaryOperator)
-HANDLE_BINARY_INST(25, Or , BinaryOperator)
-HANDLE_BINARY_INST(26, Xor , BinaryOperator)
- LAST_BINARY_INST(26)
+HANDLE_BINARY_INST(20, Shl , BinaryOperator) // Shift left (logical)
+HANDLE_BINARY_INST(21, LShr , BinaryOperator) // Shift right (logical)
+HANDLE_BINARY_INST(22, AShr , BinaryOperator) // Shift right (arithmetic)
+HANDLE_BINARY_INST(23, And , BinaryOperator)
+HANDLE_BINARY_INST(24, Or , BinaryOperator)
+HANDLE_BINARY_INST(25, Xor , BinaryOperator)
+ LAST_BINARY_INST(25)
// Memory operators...
- FIRST_MEMORY_INST(27)
-HANDLE_MEMORY_INST(27, Alloca, AllocaInst) // Stack management
-HANDLE_MEMORY_INST(28, Load , LoadInst ) // Memory manipulation instrs
-HANDLE_MEMORY_INST(29, Store , StoreInst )
-HANDLE_MEMORY_INST(30, GetElementPtr, GetElementPtrInst)
-HANDLE_MEMORY_INST(31, Fence , FenceInst )
-HANDLE_MEMORY_INST(32, AtomicCmpXchg , AtomicCmpXchgInst )
-HANDLE_MEMORY_INST(33, AtomicRMW , AtomicRMWInst )
- LAST_MEMORY_INST(33)
+ FIRST_MEMORY_INST(26)
+HANDLE_MEMORY_INST(26, Alloca, AllocaInst) // Stack management
+HANDLE_MEMORY_INST(27, Load , LoadInst ) // Memory manipulation instrs
+HANDLE_MEMORY_INST(28, Store , StoreInst )
+HANDLE_MEMORY_INST(29, GetElementPtr, GetElementPtrInst)
+HANDLE_MEMORY_INST(30, Fence , FenceInst )
+HANDLE_MEMORY_INST(31, AtomicCmpXchg , AtomicCmpXchgInst )
+HANDLE_MEMORY_INST(32, AtomicRMW , AtomicRMWInst )
+ LAST_MEMORY_INST(32)
// Cast operators ...
// NOTE: The order matters here because CastInst::isEliminableCastPair
// NOTE: (see Instructions.cpp) encodes a table based on this ordering.
- FIRST_CAST_INST(34)
-HANDLE_CAST_INST(34, Trunc , TruncInst ) // Truncate integers
-HANDLE_CAST_INST(35, ZExt , ZExtInst ) // Zero extend integers
-HANDLE_CAST_INST(36, SExt , SExtInst ) // Sign extend integers
-HANDLE_CAST_INST(37, FPToUI , FPToUIInst ) // floating point -> UInt
-HANDLE_CAST_INST(38, FPToSI , FPToSIInst ) // floating point -> SInt
-HANDLE_CAST_INST(39, UIToFP , UIToFPInst ) // UInt -> floating point
-HANDLE_CAST_INST(40, SIToFP , SIToFPInst ) // SInt -> floating point
-HANDLE_CAST_INST(41, FPTrunc , FPTruncInst ) // Truncate floating point
-HANDLE_CAST_INST(42, FPExt , FPExtInst ) // Extend floating point
-HANDLE_CAST_INST(43, PtrToInt, PtrToIntInst) // Pointer -> Integer
-HANDLE_CAST_INST(44, IntToPtr, IntToPtrInst) // Integer -> Pointer
-HANDLE_CAST_INST(45, BitCast , BitCastInst ) // Type cast
- LAST_CAST_INST(45)
+ FIRST_CAST_INST(33)
+HANDLE_CAST_INST(33, Trunc , TruncInst ) // Truncate integers
+HANDLE_CAST_INST(34, ZExt , ZExtInst ) // Zero extend integers
+HANDLE_CAST_INST(35, SExt , SExtInst ) // Sign extend integers
+HANDLE_CAST_INST(36, FPToUI , FPToUIInst ) // floating point -> UInt
+HANDLE_CAST_INST(37, FPToSI , FPToSIInst ) // floating point -> SInt
+HANDLE_CAST_INST(38, UIToFP , UIToFPInst ) // UInt -> floating point
+HANDLE_CAST_INST(39, SIToFP , SIToFPInst ) // SInt -> floating point
+HANDLE_CAST_INST(40, FPTrunc , FPTruncInst ) // Truncate floating point
+HANDLE_CAST_INST(41, FPExt , FPExtInst ) // Extend floating point
+HANDLE_CAST_INST(42, PtrToInt, PtrToIntInst) // Pointer -> Integer
+HANDLE_CAST_INST(43, IntToPtr, IntToPtrInst) // Integer -> Pointer
+HANDLE_CAST_INST(44, BitCast , BitCastInst ) // Type cast
+ LAST_CAST_INST(44)
// Other operators...
- FIRST_OTHER_INST(46)
-HANDLE_OTHER_INST(46, ICmp , ICmpInst ) // Integer comparison instruction
-HANDLE_OTHER_INST(47, FCmp , FCmpInst ) // Floating point comparison instr.
-HANDLE_OTHER_INST(48, PHI , PHINode ) // PHI node instruction
-HANDLE_OTHER_INST(49, Call , CallInst ) // Call a function
-HANDLE_OTHER_INST(50, Select , SelectInst ) // select instruction
-HANDLE_OTHER_INST(51, UserOp1, Instruction) // May be used internally in a pass
-HANDLE_OTHER_INST(52, UserOp2, Instruction) // Internal to passes only
-HANDLE_OTHER_INST(53, VAArg , VAArgInst ) // vaarg instruction
-HANDLE_OTHER_INST(54, ExtractElement, ExtractElementInst)// extract from vector
-HANDLE_OTHER_INST(55, InsertElement, InsertElementInst) // insert into vector
-HANDLE_OTHER_INST(56, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
-HANDLE_OTHER_INST(57, ExtractValue, ExtractValueInst)// extract from aggregate
-HANDLE_OTHER_INST(58, InsertValue, InsertValueInst) // insert into aggregate
-HANDLE_OTHER_INST(59, LandingPad, LandingPadInst) // Landing pad instruction.
- LAST_OTHER_INST(59)
+ FIRST_OTHER_INST(45)
+HANDLE_OTHER_INST(45, ICmp , ICmpInst ) // Integer comparison instruction
+HANDLE_OTHER_INST(46, FCmp , FCmpInst ) // Floating point comparison instr.
+HANDLE_OTHER_INST(47, PHI , PHINode ) // PHI node instruction
+HANDLE_OTHER_INST(48, Call , CallInst ) // Call a function
+HANDLE_OTHER_INST(49, Select , SelectInst ) // select instruction
+HANDLE_OTHER_INST(50, UserOp1, Instruction) // May be used internally in a pass
+HANDLE_OTHER_INST(51, UserOp2, Instruction) // Internal to passes only
+HANDLE_OTHER_INST(52, VAArg , VAArgInst ) // vaarg instruction
+HANDLE_OTHER_INST(53, ExtractElement, ExtractElementInst)// extract from vector
+HANDLE_OTHER_INST(54, InsertElement, InsertElementInst) // insert into vector
+HANDLE_OTHER_INST(55, ShuffleVector, ShuffleVectorInst) // shuffle two vectors.
+HANDLE_OTHER_INST(56, ExtractValue, ExtractValueInst)// extract from aggregate
+HANDLE_OTHER_INST(57, InsertValue, InsertValueInst) // insert into aggregate
+
+ LAST_OTHER_INST(57)
#undef FIRST_TERM_INST
#undef HANDLE_TERM_INST
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h
index cb21e6364b..69538e954f 100644
--- a/include/llvm/Instructions.h
+++ b/include/llvm/Instructions.h
@@ -2028,122 +2028,6 @@ struct OperandTraits<PHINode> : public HungoffOperandTraits<2> {
DEFINE_TRANSPARENT_OPERAND_ACCESSORS(PHINode, Value)
-//===----------------------------------------------------------------------===//
-// LandingPadInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// LandingPadInst - The landingpad instruction holds all of the information
-/// necessary to generate correct exception handling. The landingpad instruction
-/// cannot be moved from the top of a landing pad block, which itself is
-/// accessible only from the 'unwind' edge of an invoke.
-///
-class LandingPadInst : public Instruction {
- /// ReservedSpace - The number of operands actually allocated. NumOperands is
- /// the number actually in use.
- unsigned ReservedSpace;
-
- /// IsCleanup - True if the landingpad instruction is also a cleanup.
- bool IsCleanup;
- LandingPadInst(const LandingPadInst &LP);
-public:
- enum ClauseType { Catch, Filter };
-private:
- /// ClauseIdxs - This indexes into the OperandList, indicating what the
- /// values are at a given index.
- SmallVector<ClauseType, 8> ClauseIdxs;
-
- void *operator new(size_t, unsigned); // DO NOT IMPLEMENT
- // Allocate space for exactly zero operands.
- void *operator new(size_t s) {
- return User::operator new(s, 0);
- }
- void growOperands();
- void init(Function *PersFn, unsigned NumReservedValues, const Twine &NameStr);
-
- explicit LandingPadInst(Type *RetTy, Function *PersonalityFn,
- unsigned NumReservedValues, const Twine &NameStr,
- Instruction *InsertBefore)
- : Instruction(RetTy, Instruction::LandingPad, 0, 0, InsertBefore),
- IsCleanup(false) {
- init(PersonalityFn, 1 + NumReservedValues, NameStr);
- }
- explicit LandingPadInst(Type *RetTy, Function *PersonalityFn,
- unsigned NumReservedValues, const Twine &NameStr,
- BasicBlock *InsertAtEnd)
- : Instruction(RetTy, Instruction::LandingPad, 0, 0, InsertAtEnd),
- IsCleanup(false) {
- init(PersonalityFn, 1 + NumReservedValues, NameStr);
- }
-protected:
- virtual LandingPadInst *clone_impl() const;
-public:
- static LandingPadInst *Create(Type *RetTy, Function *PersonalityFn,
- unsigned NumReservedValues,
- const Twine &NameStr = "",
- Instruction *InsertBefore = 0) {
- return new LandingPadInst(RetTy, PersonalityFn, NumReservedValues, NameStr,
- InsertBefore);
- }
- static LandingPadInst *Create(Type *RetTy, Function *PersonalityFn,
- unsigned NumReservedValues,
- const Twine &NameStr, BasicBlock *InsertAtEnd) {
- return new LandingPadInst(RetTy, PersonalityFn, NumReservedValues, NameStr,
- InsertAtEnd);
- }
- ~LandingPadInst();
-
- /// Provide fast operand accessors
- DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
-
- /// getPersonalityFn - Get the personality function associated with this
- /// landing pad.
- const Function *getPersonalityFn() const {
- return cast<Function>(getOperand(0));
- }
-
- // Simple accessors.
- bool isCleanup() const { return IsCleanup; }
- void setCleanup(bool Val) { IsCleanup = Val; }
-
- /// addClause - Add a clause to the landing pad.
- void addClause(ClauseType CT, Constant *ClauseVal);
-
- /// getClauseType - Return the type of the clause at this index. The two
- /// supported clauses are Catch and Filter.
- ClauseType getClauseType(unsigned I) const {
- assert(I < ClauseIdxs.size() && "Index too large!");
- return ClauseIdxs[I];
- }
-
- /// getClauseValue - Return the value of the clause at this index.
- Constant *getClauseValue(unsigned I) const {
- assert(I + 1 < getNumOperands() && "Index too large!");
- return cast<Constant>(OperandList[I + 1]);
- }
-
- /// getNumClauses - Get the number of clauses for this landing pad.
- unsigned getNumClauses() const { return getNumOperands() - 1; }
-
- /// reserveClauses - Grow the size of the operand list to accomodate the new
- /// number of clauses.
- void reserveClauses(unsigned Size);
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const LandingPadInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::LandingPad;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-};
-
-template <>
-struct OperandTraits<LandingPadInst> : public HungoffOperandTraits<2> {
-};
-
-DEFINE_TRANSPARENT_OPERAND_ACCESSORS(LandingPadInst, Value)
//===----------------------------------------------------------------------===//
// ReturnInst Class
@@ -2733,10 +2617,6 @@ public:
Op<-1>() = reinterpret_cast<Value*>(B);
}
- // getLandingPad - Get the landingpad instruction from the landing pad block
- // (the unwind destination).
- LandingPadInst *getLandingPad() const;
-
BasicBlock *getSuccessor(unsigned i) const {
assert(i < 2 && "Successor # out of range for invoke!");
return i == 0 ? getNormalDest() : getUnwindDest();
@@ -2836,59 +2716,6 @@ private:
};
//===----------------------------------------------------------------------===//
-// ResumeInst Class
-//===----------------------------------------------------------------------===//
-
-//===---------------------------------------------------------------------------
-/// ResumeInst - Resume the propagation of an exception.
-///
-class ResumeInst : public TerminatorInst {
- ResumeInst(const ResumeInst &RI);
-
- explicit ResumeInst(LLVMContext &C, Value *Exn, Instruction *InsertBefore=0);
- ResumeInst(LLVMContext &C, Value *Exn, BasicBlock *InsertAtEnd);
-protected:
- virtual ResumeInst *clone_impl() const;
-public:
- static ResumeInst *Create(LLVMContext &C, Value *Exn,
- Instruction *InsertBefore = 0) {
- return new(1) ResumeInst(C, Exn, InsertBefore);
- }
- static ResumeInst *Create(LLVMContext &C, Value *Exn,
- BasicBlock *InsertAtEnd) {
- return new(1) ResumeInst(C, Exn, InsertAtEnd);
- }
-
- /// Provide fast operand accessors
- DECLARE_TRANSPARENT_OPERAND_ACCESSORS(Value);
-
- /// Convenience accessor.
- Value *getResumeValue() const { return Op<0>(); }
-
- unsigned getNumSuccessors() const { return 0; }
-
- // Methods for support type inquiry through isa, cast, and dyn_cast:
- static inline bool classof(const ResumeInst *) { return true; }
- static inline bool classof(const Instruction *I) {
- return I->getOpcode() == Instruction::Resume;
- }
- static inline bool classof(const Value *V) {
- return isa<Instruction>(V) && classof(cast<Instruction>(V));
- }
-private:
- virtual BasicBlock *getSuccessorV(unsigned idx) const;
- virtual unsigned getNumSuccessorsV() const;
- virtual void setSuccessorV(unsigned idx, BasicBlock *B);
-};
-
-template <>
-struct OperandTraits<ResumeInst> :
- public FixedNumOperandTraits<ResumeInst, 1> {
-};
-
-DEFINE_TRANSPARENT_OPERAND_ACCESSORS(ResumeInst, Value)
-
-//===----------------------------------------------------------------------===//
// UnreachableInst Class
//===----------------------------------------------------------------------===//
diff --git a/include/llvm/Support/IRBuilder.h b/include/llvm/Support/IRBuilder.h
index 22bec4244c..87a017d400 100644
--- a/include/llvm/Support/IRBuilder.h
+++ b/include/llvm/Support/IRBuilder.h
@@ -479,10 +479,6 @@ public:
return Insert(new UnwindInst(Context));
}
- ResumeInst *CreateResume(Value *Exn) {
- return Insert(ResumeInst::Create(Context, Exn));
- }
-
UnreachableInst *CreateUnreachable() {
return Insert(new UnreachableInst(Context));
}
@@ -1208,11 +1204,6 @@ public:
return Insert(InsertValueInst::Create(Agg, Val, Idxs), Name);
}
- Value *CreateLandingPad(Type *Ty, Function *PersFn, unsigned NumClauses,
- const Twine &Name = "") {
- return Insert(LandingPadInst::Create(Ty, PersFn, NumClauses, Name));
- }
-
//===--------------------------------------------------------------------===//
// Utility creation methods
//===--------------------------------------------------------------------===//
diff --git a/include/llvm/Support/InstVisitor.h b/include/llvm/Support/InstVisitor.h
index a661c4fac6..dc29d6a23a 100644
--- a/include/llvm/Support/InstVisitor.h
+++ b/include/llvm/Support/InstVisitor.h
@@ -163,7 +163,6 @@ public:
RetTy visitIndirectBrInst(IndirectBrInst &I) { DELEGATE(TerminatorInst);}
RetTy visitInvokeInst(InvokeInst &I) { DELEGATE(TerminatorInst);}
RetTy visitUnwindInst(UnwindInst &I) { DELEGATE(TerminatorInst);}
- RetTy visitResumeInst(ResumeInst &I) { DELEGATE(TerminatorInst);}
RetTy visitUnreachableInst(UnreachableInst &I) { DELEGATE(TerminatorInst);}
RetTy visitICmpInst(ICmpInst &I) { DELEGATE(CmpInst);}
RetTy visitFCmpInst(FCmpInst &I) { DELEGATE(CmpInst);}
@@ -195,7 +194,6 @@ public:
RetTy visitShuffleVectorInst(ShuffleVectorInst &I) { DELEGATE(Instruction); }
RetTy visitExtractValueInst(ExtractValueInst &I) { DELEGATE(Instruction);}
RetTy visitInsertValueInst(InsertValueInst &I) { DELEGATE(Instruction); }
- RetTy visitLandingPadInst(LandingPadInst &I) { DELEGATE(Instruction); }
// Next level propagators: If the user does not overload a specific
// instruction type, they can overload one of these to get the whole class
diff --git a/lib/AsmParser/LLLexer.cpp b/lib/AsmParser/LLLexer.cpp
index d16cac1af2..95b40c9838 100644
--- a/lib/AsmParser/LLLexer.cpp
+++ b/lib/AsmParser/LLLexer.cpp
@@ -584,11 +584,6 @@ lltok::Kind LLLexer::LexIdentifier() {
KEYWORD(x);
KEYWORD(blockaddress);
-
- KEYWORD(personality);
- KEYWORD(cleanup);
- KEYWORD(catch);
- KEYWORD(filter);
#undef KEYWORD
// Keywords for types.
@@ -641,7 +636,6 @@ lltok::Kind LLLexer::LexIdentifier() {
INSTKEYWORD(switch, Switch);
INSTKEYWORD(indirectbr, IndirectBr);
INSTKEYWORD(invoke, Invoke);
- INSTKEYWORD(resume, Resume);
INSTKEYWORD(unwind, Unwind);
INSTKEYWORD(unreachable, Unreachable);
@@ -658,7 +652,6 @@ lltok::Kind LLLexer::LexIdentifier() {
INSTKEYWORD(shufflevector, ShuffleVector);
INSTKEYWORD(extractvalue, ExtractValue);
INSTKEYWORD(insertvalue, InsertValue);
- INSTKEYWORD(landingpad, LandingPad);
#undef INSTKEYWORD
// Check for [us]0x[0-9A-Fa-f]+ which are Hexadecimal constant generated by
@@ -686,6 +679,7 @@ lltok::Kind LLLexer::LexIdentifier() {
return lltok::Error;
}
+
/// Lex0x: Handle productions that start with 0x, knowing that it matches and
/// that this is not a label:
/// HexFPConstant 0x[0-9A-Fa-f]+
diff --git a/lib/AsmParser/LLParser.cpp b/lib/AsmParser/LLParser.cpp
index f412c1c89a..4727fac8ef 100644
--- a/lib/AsmParser/LLParser.cpp
+++ b/lib/AsmParser/LLParser.cpp
@@ -2885,7 +2885,6 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
case lltok::kw_switch: return ParseSwitch(Inst, PFS);
case lltok::kw_indirectbr: return ParseIndirectBr(Inst, PFS);
case lltok::kw_invoke: return ParseInvoke(Inst, PFS);
- case lltok::kw_resume: return ParseResume(Inst, PFS);
// Binary Operators.
case lltok::kw_add:
case lltok::kw_sub:
@@ -2945,7 +2944,6 @@ int LLParser::ParseInstruction(Instruction *&Inst, BasicBlock *BB,
case lltok::kw_insertelement: return ParseInsertElement(Inst, PFS);
case lltok::kw_shufflevector: return ParseShuffleVector(Inst, PFS);
case lltok::kw_phi: return ParsePHI(Inst, PFS);
- case lltok::kw_landingpad: return ParseLandingPad(Inst, PFS);
case lltok::kw_call: return ParseCall(Inst, PFS, false);
case lltok::kw_tail: return ParseCall(Inst, PFS, true);
// Memory.
@@ -3255,18 +3253,7 @@ bool LLParser::ParseInvoke(Instruction *&Inst, PerFunctionState &PFS) {
return false;
}
-/// ParseResume
-/// ::= 'resume' TypeAndValue
-bool LLParser::ParseResume(Instruction *&Inst, PerFunctionState &PFS) {
- Value *Exn; LocTy ExnLoc;
- LocTy Loc = Lex.getLoc();
- if (ParseTypeAndValue(Exn, ExnLoc, PFS))
- return true;
- ResumeInst *RI = ResumeInst::Create(Context, Exn);
- Inst = RI;
- return false;
-}
//===----------------------------------------------------------------------===//
// Binary Operators.
@@ -3514,58 +3501,6 @@ int LLParser::ParsePHI(Instruction *&Inst, PerFunctionState &PFS) {
return AteExtraComma ? InstExtraComma : InstNormal;
}
-/// ParseLandingPad
-/// ::= 'landingpad' Type 'personality' TypeAndValue 'cleanup'?
-/// (ClauseID ClauseList)+
-/// ClauseID
-/// ::= 'catch'
-/// ::= 'filter'
-/// ClauseList
-/// ::= TypeAndValue (',' TypeAndValue)*