diff options
author | Bill Wendling <isanbard@gmail.com> | 2011-07-30 05:42:50 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2011-07-30 05:42:50 +0000 |
commit | 10c6d12a9fd4dab411091f64db4db69670b88850 (patch) | |
tree | 629a8bff765bcf0baa378c7367ab1d903f3910fc /include/llvm | |
parent | efd7919618d59bd0e3fcf861cc0d1eacbbed0ac6 (diff) | |
download | external_llvm-10c6d12a9fd4dab411091f64db4db69670b88850.tar.gz external_llvm-10c6d12a9fd4dab411091f64db4db69670b88850.tar.bz2 external_llvm-10c6d12a9fd4dab411091f64db4db69670b88850.zip |
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
Diffstat (limited to 'include/llvm')
-rw-r--r-- | include/llvm/Bitcode/LLVMBitCodes.h | 8 | ||||
-rw-r--r-- | include/llvm/CodeGen/FunctionLoweringInfo.h | 5 | ||||
-rw-r--r-- | include/llvm/Instruction.def | 123 | ||||
-rw-r--r-- | include/llvm/Instructions.h | 173 | ||||
-rw-r--r-- | include/llvm/Support/IRBuilder.h | 9 | ||||
-rw-r--r-- | include/llvm/Support/InstVisitor.h | 2 |
6 files changed, 64 insertions, 256 deletions
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 |