|
LLVM
4.0.0
|
Multiway switch. More...
#include <Instructions.h>
Classes | |
| class | CaseIt |
| class | CaseIteratorT |
Public Member Functions | |
| void * | operator new (size_t, unsigned)=delete |
| DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Value) | |
| Provide fast operand accessors. More... | |
| Value * | getCondition () const |
| void | setCondition (Value *V) |
| BasicBlock * | getDefaultDest () const |
| void | setDefaultDest (BasicBlock *DefaultCase) |
| unsigned | getNumCases () const |
| Return the number of 'cases' in this switch instruction, excluding the default case. More... | |
| CaseIt | case_begin () |
| Returns a read/write iterator that points to the first case in the SwitchInst. More... | |
| ConstCaseIt | case_begin () const |
| Returns a read-only iterator that points to the first case in the SwitchInst. More... | |
| CaseIt | case_end () |
| Returns a read/write iterator that points one past the last in the SwitchInst. More... | |
| ConstCaseIt | case_end () const |
| Returns a read-only iterator that points one past the last in the SwitchInst. More... | |
| iterator_range< CaseIt > | cases () |
| Iteration adapter for range-for loops. More... | |
| iterator_range< ConstCaseIt > | cases () const |
| Constant iteration adapter for range-for loops. More... | |
| CaseIt | case_default () |
| Returns an iterator that points to the default case. More... | |
| ConstCaseIt | case_default () const |
| CaseIt | findCaseValue (const ConstantInt *C) |
| Search all of the case values for the specified constant. More... | |
| ConstCaseIt | findCaseValue (const ConstantInt *C) const |
| ConstantInt * | findCaseDest (BasicBlock *BB) |
| Finds the unique case value for a given successor. More... | |
| void | addCase (ConstantInt *OnVal, BasicBlock *Dest) |
| Add an entry to the switch instruction. More... | |
| void | removeCase (CaseIt i) |
| This method removes the specified case and its successor from the switch instruction. More... | |
| unsigned | getNumSuccessors () const |
| BasicBlock * | getSuccessor (unsigned idx) const |
| void | setSuccessor (unsigned idx, BasicBlock *NewSucc) |
Public Member Functions inherited from llvm::TerminatorInst | |
| unsigned | getNumSuccessors () const |
| Return the number of successors that this terminator has. More... | |
| BasicBlock * | getSuccessor (unsigned idx) const |
| Return the specified successor. More... | |
| void | setSuccessor (unsigned idx, BasicBlock *B) |
| Update the specified successor to point at the provided block. More... | |
| bool | isExceptional () const |
| succ_range | successors () |
| succ_const_range | successors () const |
Public Member Functions inherited from llvm::Instruction | |
| Instruction (const Instruction &)=delete | |
| Instruction & | operator= (const Instruction &)=delete |
| ~Instruction () override | |
| Instruction * | user_back () |
| Specialize the methods defined in Value, as we know that an instruction can only be used by other instructions. More... | |
| const Instruction * | user_back () const |
| const BasicBlock * | getParent () const |
| BasicBlock * | getParent () |
| const Module * | getModule () const |
| Return the module owning the function this instruction belongs to or nullptr it the function does not have a module. More... | |
| Module * | getModule () |
| const Function * | getFunction () const |
| Return the function this instruction belongs to. More... | |
| Function * | getFunction () |
| void | removeFromParent () |
| This method unlinks 'this' from the containing basic block, but does not delete it. More... | |
| SymbolTableList< Instruction > ::iterator | eraseFromParent () |
| This method unlinks 'this' from the containing basic block and deletes it. More... | |
| void | insertBefore (Instruction *InsertPos) |
| Insert an unlinked instruction into a basic block immediately before the specified instruction. More... | |
| void | insertAfter (Instruction *InsertPos) |
| Insert an unlinked instruction into a basic block immediately after the specified instruction. More... | |
| void | moveBefore (Instruction *MovePos) |
| Unlink this instruction from its current basic block and insert it into the basic block that MovePos lives in, right before MovePos. More... | |
| void | moveBefore (BasicBlock &BB, SymbolTableList< Instruction >::iterator I) |
| Unlink this instruction and insert into BB before I. More... | |
| unsigned | getOpcode () const |
| Returns a member of one of the enums like Instruction::Add. More... | |
| const char * | getOpcodeName () const |
| bool | isTerminator () const |
| bool | isBinaryOp () const |
| bool | isShift () |
| bool | isCast () const |
| bool | isFuncletPad () const |
| bool | isLogicalShift () const |
| Return true if this is a logical shift left or a logical shift right. More... | |
| bool | isArithmeticShift () const |
| Return true if this is an arithmetic shift right. More... | |
| bool | isBitwiseLogicOp () const |
| Return true if this is and/or/xor. More... | |
| bool | hasMetadata () const |
| Return true if this instruction has any metadata attached to it. More... | |
| bool | hasMetadataOtherThanDebugLoc () const |
| Return true if this instruction has metadata attached to it other than a debug location. More... | |
| MDNode * | getMetadata (unsigned KindID) const |
| Get the metadata of given kind attached to this Instruction. More... | |
| MDNode * | getMetadata (StringRef Kind) const |
| Get the metadata of given kind attached to this Instruction. More... | |
| void | getAllMetadata (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| Get all metadata attached to this Instruction. More... | |
| void | getAllMetadataOtherThanDebugLoc (SmallVectorImpl< std::pair< unsigned, MDNode * >> &MDs) const |
| This does the same thing as getAllMetadata, except that it filters out the debug location. More... | |
| void | getAAMetadata (AAMDNodes &N, bool Merge=false) const |
| Fills the AAMDNodes structure with AA metadata from this instruction. More... | |
| void | setMetadata (unsigned KindID, MDNode *Node) |
| Set the metadata of the specified kind to the specified node. More... | |
| void | setMetadata (StringRef Kind, MDNode *Node) |
| void | copyMetadata (const Instruction &SrcInst, ArrayRef< unsigned > WL=ArrayRef< unsigned >()) |
Copy metadata from SrcInst to this instruction. More... | |
| void | swapProfMetadata () |
| If the instruction has "branch_weights" MD_prof metadata and the MDNode has three operands (including name string), swap the order of the metadata. More... | |
| void | setAAMetadata (const AAMDNodes &N) |
| Sets the metadata on this instruction from the AAMDNodes structure. More... | |
| bool | extractProfMetadata (uint64_t &TrueVal, uint64_t &FalseVal) const |
| Retrieve the raw weight values of a conditional branch or select. More... | |
| bool | extractProfTotalWeight (uint64_t &TotalVal) const |
| Retrieve total raw weight values of a branch. More... | |
| void | setDebugLoc (DebugLoc Loc) |
| Set the debug location information for this instruction. More... | |
| const DebugLoc & | getDebugLoc () const |
| Return the debug location for this node as a DebugLoc. More... | |
| void | setHasNoUnsignedWrap (bool b=true) |
| Set or clear the nsw flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoSignedWrap (bool b=true) |
| Set or clear the nsw flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setIsExact (bool b=true) |
| Set or clear the exact flag on this instruction, which must be an operator which supports this flag. More... | |
| bool | hasNoUnsignedWrap () const |
| Determine whether the no unsigned wrap flag is set. More... | |
| bool | hasNoSignedWrap () const |
| Determine whether the no signed wrap flag is set. More... | |
| bool | isExact () const |
| Determine whether the exact flag is set. More... | |
| void | setHasUnsafeAlgebra (bool B) |
| Set or clear the unsafe-algebra flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoNaNs (bool B) |
| Set or clear the no-nans flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoInfs (bool B) |
| Set or clear the no-infs flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasNoSignedZeros (bool B) |
| Set or clear the no-signed-zeros flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setHasAllowReciprocal (bool B) |
| Set or clear the allow-reciprocal flag on this instruction, which must be an operator which supports this flag. More... | |
| void | setFastMathFlags (FastMathFlags FMF) |
| Convenience function for setting multiple fast-math flags on this instruction, which must be an operator which supports these flags. More... | |
| void | copyFastMathFlags (FastMathFlags FMF) |
| Convenience function for transferring all fast-math flag values to this instruction, which must be an operator which supports these flags. More... | |
| bool | hasUnsafeAlgebra () const |
| Determine whether the unsafe-algebra flag is set. More... | |
| bool | hasNoNaNs () const |
| Determine whether the no-NaNs flag is set. More... | |
| bool | hasNoInfs () const |
| Determine whether the no-infs flag is set. More... | |
| bool | hasNoSignedZeros () const |
| Determine whether the no-signed-zeros flag is set. More... | |
| bool | hasAllowReciprocal () const |
| Determine whether the allow-reciprocal flag is set. More... | |
| FastMathFlags | getFastMathFlags () const |
| Convenience function for getting all the fast-math flags, which must be an operator which supports these flags. More... | |
| void | copyFastMathFlags (const Instruction *I) |
| Copy I's fast-math flags. More... | |
| void | copyIRFlags (const Value *V) |
| Convenience method to copy supported wrapping, exact, and fast-math flags from V to this instruction. More... | |
| void | andIRFlags (const Value *V) |
| Logical 'and' of any supported wrapping, exact, and fast-math flags of V and this instruction. More... | |
| bool | isAssociative () const |
| Return true if the instruction is associative: More... | |
| bool | isCommutative () const |
| Return true if the instruction is commutative: More... | |
| bool | isIdempotent () const |
| Return true if the instruction is idempotent: More... | |
| bool | isNilpotent () const |
| Return true if the instruction is nilpotent: More... | |
| bool | mayWriteToMemory () const |
| Return true if this instruction may modify memory. More... | |
| bool | mayReadFromMemory () const |
| Return true if this instruction may read memory. More... | |
| bool | mayReadOrWriteMemory () const |
| Return true if this instruction may read or write memory. More... | |
| bool | isAtomic () const |
| Return true if this instruction has an AtomicOrdering of unordered or higher. More... | |
| bool | mayThrow () const |
| Return true if this instruction may throw an exception. More... | |
| bool | isFenceLike () const |
| Return true if this instruction behaves like a memory fence: it can load or store to memory location without being given a memory location. More... | |
| bool | mayHaveSideEffects () const |
| Return true if the instruction may have side effects. More... | |
| bool | isEHPad () const |
| Return true if the instruction is a variety of EH-block. More... | |
| Instruction * | clone () const |
| Create a copy of 'this' instruction that is identical in all ways except the following: More... | |
| bool | isIdenticalTo (const Instruction *I) const |
| Return true if the specified instruction is exactly identical to the current one. More... | |
| bool | isIdenticalToWhenDefined (const Instruction *I) const |
| This is like isIdenticalTo, except that it ignores the SubclassOptionalData flags, which may specify conditions under which the instruction's result is undefined. More... | |
| bool | isSameOperationAs (const Instruction *I, unsigned flags=0) const |
| This function determines if the specified instruction executes the same operation as the current one. More... | |
| bool | isUsedOutsideOfBlock (const BasicBlock *BB) const |
| Return true if there are any uses of this instruction in blocks other than the specified block. More... | |
| void | dropUnknownNonDebugMetadata (ArrayRef< unsigned > KnownIDs) |
| Drop all unknown metadata except for debug locations. More... | |
| void | dropUnknownNonDebugMetadata () |
| void | dropUnknownNonDebugMetadata (unsigned ID1) |
| void | dropUnknownNonDebugMetadata (unsigned ID1, unsigned ID2) |
Public Member Functions inherited from llvm::User | |
| User (const User &)=delete | |
| ~User () override=default | |
| void | operator delete (void *Usr) |
| Free memory allocated for User and Use objects. More... | |
| void | operator delete (void *, unsigned) |
| Placement delete - required by std, but never called. More... | |
| void | operator delete (void *, unsigned, bool) |
| Placement delete - required by std, but never called. More... | |
| Use * | getOperandList () |
| const Use * | getOperandList () const |
| Value * | getOperand (unsigned i) const |
| void | setOperand (unsigned i, Value *Val) |
| const Use & | getOperandUse (unsigned i) const |
| Use & | getOperandUse (unsigned i) |
| unsigned | getNumOperands () const |
| ArrayRef< const uint8_t > | getDescriptor () const |
| Returns the descriptor co-allocated with this User instance. More... | |
| MutableArrayRef< uint8_t > | getDescriptor () |
| Returns the descriptor co-allocated with this User instance. More... | |
| void | setGlobalVariableNumOperands (unsigned NumOps) |
| Set the number of operands on a GlobalVariable. More... | |
| void | setNumHungOffUseOperands (unsigned NumOps) |
| Subclasses with hung off uses need to manage the operand count themselves. More... | |
| op_iterator | op_begin () |
| const_op_iterator | op_begin () const |
| op_iterator | op_end () |
| const_op_iterator | op_end () const |
| op_range | operands () |
| const_op_range | operands () const |
| value_op_iterator | value_op_begin () |
| value_op_iterator | value_op_end () |
| iterator_range< value_op_iterator > | operand_values () |
| const_value_op_iterator | value_op_begin () const |
| const_value_op_iterator | value_op_end () const |
| iterator_range < const_value_op_iterator > | operand_values () const |
| void | dropAllReferences () |
| Drop all references to operands. More... | |
| void | replaceUsesOfWith (Value *From, Value *To) |
| Replace uses of one Value with another. More... | |
Public Member Functions inherited from llvm::Value | |
| Value (const Value &)=delete | |
| void | operator= (const Value &)=delete |
| virtual | ~Value () |
| void | dump () const |
| Support for debugging, callable in GDB: V->dump() More... | |
| Type * | getType () const |
| All values are typed, get the type of this value. More... | |
| LLVMContext & | getContext () const |
| All values hold a context through their type. More... | |
| bool | hasName () const |
| ValueName * | getValueName () const |
| void | setValueName (ValueName *VN) |
| StringRef | getName () const |
| Return a constant reference to the value's name. More... | |
| void | setName (const Twine &Name) |
| Change the name of the value. More... | |
| void | takeName (Value *V) |
| Transfer the name from V to this value. More... | |
| void | replaceAllUsesWith (Value *V) |
| Change all uses of this to point to a new Value. More... | |
| void | replaceNonMetadataUsesWith (Value *V) |
| Change non-metadata uses of this to point to a new Value. More... | |
| void | replaceUsesOutsideBlock (Value *V, BasicBlock *BB) |
| replaceUsesOutsideBlock - Go through the uses list for this definition and make each use point to "V" instead of "this" when the use is outside the block. More... | |
| void | assertModuleIsMaterialized () const |
| bool | use_empty () const |
| use_iterator | materialized_use_begin () |
| const_use_iterator | materialized_use_begin () const |
| use_iterator | use_begin () |
| const_use_iterator | use_begin () const |
| use_iterator | use_end () |
| const_use_iterator | use_end () const |
| iterator_range< use_iterator > | materialized_uses () |
| iterator_range < const_use_iterator > | materialized_uses () const |
| iterator_range< use_iterator > | uses () |
| iterator_range < const_use_iterator > | uses () const |
| bool | user_empty () const |
| user_iterator | materialized_user_begin () |
| const_user_iterator | materialized_user_begin () const |
| user_iterator | user_begin () |
| const_user_iterator | user_begin () const |
| user_iterator | user_end () |
| const_user_iterator | user_end () const |
| User * | user_back () |
| const User * | user_back () const |
| iterator_range< user_iterator > | materialized_users () |
| iterator_range < const_user_iterator > | materialized_users () const |
| iterator_range< user_iterator > | users () |
| iterator_range < const_user_iterator > | users () const |
| bool | hasOneUse () const |
| Return true if there is exactly one user of this value. More... | |
| bool | hasNUses (unsigned N) const |
| Return true if this Value has exactly N users. More... | |
| bool | hasNUsesOrMore (unsigned N) const |
| Return true if this value has N users or more. More... | |
| bool | isUsedInBasicBlock (const BasicBlock *BB) const |
| Check if this value is used in the specified basic block. More... | |
| unsigned | getNumUses () const |
| This method computes the number of uses of this Value. More... | |
| void | addUse (Use &U) |
| This method should only be used by the Use class. More... | |
| unsigned | getValueID () const |
| Return an ID for the concrete type of this object. More... | |
| unsigned | getRawSubclassOptionalData () const |
| Return the raw optional flags value contained in this value. More... | |
| void | clearSubclassOptionalData () |
| Clear the optional flags contained in this value. More... | |
| bool | hasSameSubclassOptionalData (const Value *V) const |
| Check the optional flags for equality. More... | |
| bool | hasValueHandle () const |
| Return true if there is a value handle associated with this value. More... | |
| bool | isUsedByMetadata () const |
| Return true if there is metadata referencing this value. More... | |
| bool | isSwiftError () const |
| Return true if this value is a swifterror value. More... | |
| Value * | stripPointerCasts () |
| Strip off pointer casts, all-zero GEPs, and aliases. More... | |
| const Value * | stripPointerCasts () const |
| Value * | stripPointerCastsNoFollowAliases () |
| Strip off pointer casts and all-zero GEPs. More... | |
| const Value * | stripPointerCastsNoFollowAliases () const |
| Value * | stripInBoundsConstantOffsets () |
| Strip off pointer casts and all-constant inbounds GEPs. More... | |
| const Value * | stripInBoundsConstantOffsets () const |
| Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
| Accumulate offsets from stripInBoundsConstantOffsets(). More... | |
| const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
| Value * | stripInBoundsOffsets () |
| Strip off pointer casts and inbounds GEPs. More... | |
| const Value * | stripInBoundsOffsets () const |
| unsigned | getPointerDereferenceableBytes (const DataLayout &DL, bool &CanBeNull) const |
| Returns the number of bytes known to be dereferenceable for the pointer value. More... | |
| unsigned | getPointerAlignment (const DataLayout &DL) const |
| Returns an alignment of the pointer value. More... | |
| Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
| Translate PHI node to its predecessor from the given basic block. More... | |
| const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
| void | mutateType (Type *Ty) |
| Mutate the type of this Value to be of the specified type. More... | |
| template<class Compare > | |
| void | sortUseList (Compare Cmp) |
| Sort the use-list. More... | |
| void | reverseUseList () |
| Reverse the use-list. More... | |
| void | print (raw_ostream &O, bool IsForDebug=false) const |
| Implement operator<< on Value. More... | |
| void | print (raw_ostream &O, ModuleSlotTracker &MST, bool IsForDebug=false) const |
| void | printAsOperand (raw_ostream &O, bool PrintType=true, const Module *M=nullptr) const |
| Print the name of this Value out to the specified raw_ostream. More... | |
| void | printAsOperand (raw_ostream &O, bool PrintType, ModuleSlotTracker &MST) const |
Public Member Functions inherited from llvm::ilist_node_with_parent< Instruction, BasicBlock > | |
| Instruction * | getPrevNode () |
| const Instruction * | getPrevNode () const |
Get the previous node, or nullptr for the list head. More... | |
| Instruction * | getNextNode () |
Get the next node, or nullptr for the list tail. More... | |
| const Instruction * | getNextNode () const |
Get the next node, or nullptr for the list tail. More... | |
Public Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options...>::type > | |
| self_iterator | getIterator () |
| const_self_iterator | getIterator () const |
| reverse_self_iterator | getReverseIterator () |
| const_reverse_self_iterator | getReverseIterator () const |
| bool | isSentinel () const |
| Check whether this is the sentinel node. More... | |
Static Public Member Functions | |
| static SwitchInst * | Create (Value *Value, BasicBlock *Default, unsigned NumCases, Instruction *InsertBefore=nullptr) |
| static SwitchInst * | Create (Value *Value, BasicBlock *Default, unsigned NumCases, BasicBlock *InsertAtEnd) |
| static bool | classof (const Instruction *I) |
| static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::TerminatorInst | |
| static bool | classof (const Instruction *I) |
| static bool | classof (const Value *V) |
Static Public Member Functions inherited from llvm::Instruction | |
| static const char * | getOpcodeName (unsigned OpCode) |
| static bool | isTerminator (unsigned OpCode) |
| static bool | isBinaryOp (unsigned Opcode) |
| static bool | isShift (unsigned Opcode) |
| Determine if the Opcode is one of the shift instructions. More... | |
| static bool | isCast (unsigned OpCode) |
| Determine if the OpCode is one of the CastInst instructions. More... | |
| static bool | isFuncletPad (unsigned OpCode) |
| Determine if the OpCode is one of the FuncletPadInst instructions. More... | |
| static bool | isAssociative (unsigned op) |
| Return true if the instruction is associative: More... | |
| static bool | isCommutative (unsigned op) |
| Return true if the instruction is commutative: More... | |
| static bool | isIdempotent (unsigned op) |
| Return true if the instruction is idempotent: More... | |
| static bool | isNilpotent (unsigned op) |
| Return true if the instruction is nilpotent: More... | |
| static bool | classof (const Value *V) |
| Methods for support type inquiry through isa, cast, and dyn_cast: More... | |
Static Public Member Functions inherited from llvm::User | |
| static bool | classof (const Value *V) |
Static Public Attributes | |
| static const unsigned | DefaultPseudoIndex = static_cast<unsigned>(~0L-1) |
Static Public Attributes inherited from llvm::Value | |
| static const unsigned | MaxAlignmentExponent = 29 |
| The maximum alignment for instructions. More... | |
| static const unsigned | MaximumAlignment = 1u << MaxAlignmentExponent |
Protected Member Functions | |
| SwitchInst * | cloneImpl () const |
Protected Member Functions inherited from llvm::TerminatorInst | |
| TerminatorInst (Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr) | |
| TerminatorInst (Type *Ty, Instruction::TermOps iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) | |
| ~TerminatorInst () override | |
Protected Member Functions inherited from llvm::Instruction | |
| void | setInstructionSubclassData (unsigned short D) |
| unsigned | getSubclassDataFromInstruction () const |
| Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, Instruction *InsertBefore=nullptr) | |
| Instruction (Type *Ty, unsigned iType, Use *Ops, unsigned NumOps, BasicBlock *InsertAtEnd) | |
Protected Member Functions inherited from llvm::User | |
| void * | operator new (size_t Size) |
| Allocate a User with an operand pointer co-allocated. More... | |
| void * | operator new (size_t Size, unsigned Us) |
| Allocate a User with the operands co-allocated. More... | |
| void * | operator new (size_t Size, unsigned Us, unsigned DescBytes) |
| Allocate a User with the operands co-allocated. More... | |
| User (Type *ty, unsigned vty, Use *, unsigned NumOps) | |
| void | allocHungoffUses (unsigned N, bool IsPhi=false) |
| Allocate the array of Uses, followed by a pointer (with bottom bit set) to the User. More... | |
| void | growHungoffUses (unsigned N, bool IsPhi=false) |
| Grow the number of hung off uses. More... | |
| template<int Idx> | |
| Use & | Op () |
| template<int Idx> | |
| const Use & | Op () const |
Protected Member Functions inherited from llvm::Value | |
| Value (Type *Ty, unsigned scid) | |
| unsigned short | getSubclassDataFromValue () const |
| void | setValueSubclassData (unsigned short D) |
Protected Member Functions inherited from llvm::ilist_node_with_parent< Instruction, BasicBlock > | |
| ilist_node_with_parent ()=default | |
Protected Member Functions inherited from llvm::ilist_node_impl< ilist_detail::compute_node_options< Instruction, Options...>::type > | |
| ilist_node_impl ()=default | |
Friends | |
| class | Instruction |
Multiway switch.
Definition at line 3044 of file Instructions.h.
| typedef CaseIteratorT<const SwitchInst, const ConstantInt, const BasicBlock> llvm::SwitchInst::ConstCaseIt |
Definition at line 3177 of file Instructions.h.
| void SwitchInst::addCase | ( | ConstantInt * | OnVal, |
| BasicBlock * | Dest | ||
| ) |
Add an entry to the switch instruction.
addCase - Add an entry to the switch instruction...
Note: This action invalidates case_end(). Old case_end() iterator will point to the added case.
Definition at line 3650 of file Instructions.cpp.
References assert(), getNumCases(), llvm::User::getNumOperands(), llvm::User::setNumHungOffUseOperands(), llvm::SwitchInst::CaseIt::setSuccessor(), and llvm::SwitchInst::CaseIt::setValue().
Referenced by SimplifyBranchOnICmpChain(), and TryToSimplifyUncondBranchWithICmpInIt().
|
inline |
Returns a read/write iterator that points to the first case in the SwitchInst.
Definition at line 3232 of file Instructions.h.
Referenced by ForwardSwitchConditionToPHI(), processSwitch(), ReduceSwitchRange(), SwitchToLookupTable(), and llvm::Interpreter::visitSwitchInst().
|
inline |
Returns a read-only iterator that points to the first case in the SwitchInst.
Definition at line 3238 of file Instructions.h.
|
inline |
Returns an iterator that points to the default case.
Note: this iterator allows to resolve successor only. Attempt to resolve case value causes an assertion. Also note, that increment and decrement also causes an assertion and makes iterator invalid.
Definition at line 3269 of file Instructions.h.
Referenced by EliminateDeadSwitchCases(), handleSwitchExpect(), and TryToSimplifyUncondBranchWithICmpInIt().
|
inline |
Definition at line 3272 of file Instructions.h.
|
inline |
Returns a read/write iterator that points one past the last in the SwitchInst.
Definition at line 3244 of file Instructions.h.
Referenced by ForwardSwitchConditionToPHI(), handleFinalSuspend(), processSwitch(), ReduceSwitchRange(), SwitchToLookupTable(), and llvm::Interpreter::visitSwitchInst().
|
inline |
Returns a read-only iterator that points one past the last in the SwitchInst.
Definition at line 3250 of file Instructions.h.
|
inline |
Iteration adapter for range-for loops.
Definition at line 3255 of file Instructions.h.
References llvm::make_range().
Referenced by EliminateDeadSwitchCases(), InitializeUniqueCases(), ReduceSwitchRange(), TurnSwitchRangeIntoICmp(), and llvm::InstCombiner::visitSwitchInst().
|
inline |
Constant iteration adapter for range-for loops.
Definition at line 3260 of file Instructions.h.
References llvm::make_range().
|
inlinestatic |
Definition at line 3333 of file Instructions.h.
References llvm::Instruction::getOpcode(), and Switch().
Definition at line 3336 of file Instructions.h.
|
protected |
Definition at line 3962 of file Instructions.cpp.
|
inlinestatic |
Definition at line 3198 of file Instructions.h.
Referenced by llvm::IRBuilder< TargetFolder >::CreateSwitch().
|
inlinestatic |
Definition at line 3204 of file Instructions.h.
| llvm::SwitchInst::DECLARE_TRANSPARENT_OPERAND_ACCESSORS | ( | Value | ) |
Provide fast operand accessors.
|
inline |
Finds the unique case value for a given successor.
Returns null if the successor is not found, not unique, or is the default case.
Definition at line 3295 of file Instructions.h.
References i.
Referenced by TryToSimplifyUncondBranchWithICmpInIt().
|
inline |
Search all of the case values for the specified constant.
If it is explicitly handled, return the case iterator of it, otherwise return default case iterator to indicate that it is handled by the default handler.
Definition at line 3280 of file Instructions.h.
Referenced by EliminateDeadSwitchCases(), handleSwitchExpect(), SimplifySwitchOnSelect(), and TryToSimplifyUncondBranchWithICmpInIt().
|
inline |
Definition at line 3286 of file Instructions.h.
|
inline |
Definition at line 3213 of file Instructions.h.
Referenced by EliminateDeadSwitchCases(), ForwardSwitchConditionToPHI(), GetCaseResults(), handleSwitchExpect(), processSwitch(), ReduceSwitchRange(), SwitchToLookupTable(), SwitchToSelect(), TryToSimplifyUncondBranchWithICmpInIt(), TurnSwitchRangeIntoICmp(), llvm::Interpreter::visitSwitchInst(), and llvm::InstCombiner::visitSwitchInst().
|
inline |
Definition at line 3216 of file Instructions.h.
Referenced by EliminateDeadSwitchCases(), InitializeUniqueCases(), SwitchToLookupTable(), TryToSimplifyUncondBranchWithICmpInIt(), TurnSwitchRangeIntoICmp(), and llvm::Interpreter::visitSwitchInst().
|
inline |
Return the number of 'cases' in this switch instruction, excluding the default case.
Definition at line 3226 of file Instructions.h.
Referenced by addCase(), EliminateDeadSwitchCases(), handleSwitchExpect(), llvm::SwitchInst::CaseIteratorT< SwitchInst, ConstantInt, BasicBlock >::operator++(), llvm::SwitchInst::CaseIteratorT< SwitchInst, ConstantInt, BasicBlock >::operator--(), processSwitch(), ReduceSwitchRange(), ShouldBuildLookupTable(), SimplifySwitchOnSelect(), SwitchToLookupTable(), TryToSimplifyUncondBranchWithICmpInIt(), and TurnSwitchRangeIntoICmp().
|
inline |
Definition at line 3322 of file Instructions.h.
Referenced by RemoveSwitchAfterSelectConversion(), and SwitchToLookupTable().
|
inline |
Definition at line 3323 of file Instructions.h.
References assert().
Referenced by llvm::SwitchInst::CaseIteratorT< SwitchInst, ConstantInt, BasicBlock >::getCaseSuccessor(), RemoveSwitchAfterSelectConversion(), SwitchToLookupTable(), and TurnSwitchRangeIntoICmp().
|
delete |
| void SwitchInst::removeCase | ( | CaseIt | i | ) |
This method removes the specified case and its successor from the switch instruction.
removeCase - This method removes the specified case and its successor from the switch instruction.
Note that this operation may reorder the remaining cases at index idx and above. Note: This action invalidates iterators for all cases following the one removed, including the case_end() iterator.
Definition at line 3665 of file Instructions.cpp.
References assert(), llvm::SwitchInst::CaseIteratorT< SwitchInstTy, ConstantIntTy, BasicBlockTy >::getCaseIndex(), llvm::User::getNumOperands(), llvm::User::getOperandList(), llvm::Use::set(), and llvm::User::setNumHungOffUseOperands().
Referenced by EliminateDeadSwitchCases(), handleFinalSuspend(), and processSwitch().
|
inline |
Definition at line 3214 of file Instructions.h.
Referenced by handleSwitchExpect(), processSwitch(), and llvm::InstCombiner::visitSwitchInst().
|
inline |
Definition at line 3220 of file Instructions.h.
Referenced by EliminateDeadSwitchCases().
|
inline |
Definition at line 3327 of file Instructions.h.
References assert().
Referenced by llvm::SwitchInst::CaseIt::setSuccessor().
|
friend |
Definition at line 3077 of file Instructions.h.
Definition at line 3085 of file Instructions.h.
1.8.6