LLVM 20.0.0git
|
A sandboxir::User has operands. More...
#include "llvm/SandboxIR/User.h"
Public Types | |
using | op_iterator = OperandUseIterator |
using | const_op_iterator = OperandUseIterator |
using | op_range = iterator_range< op_iterator > |
using | const_op_range = iterator_range< const_op_iterator > |
Public Types inherited from llvm::sandboxir::Value | |
enum class | ClassID : unsigned { DEF_VALUE , DEF_USER , DEF_CONST , DEF_INSTR } |
using | use_iterator = UserUseIterator |
using | const_use_iterator = UserUseIterator |
using | user_iterator = mapped_iterator< sandboxir::UserUseIterator, UseToUser > |
using | const_user_iterator = user_iterator |
Static Public Member Functions | |
static bool | classof (const Value *From) |
For isa/dyn_cast. | |
Protected Member Functions | |
User (ClassID ID, llvm::Value *V, Context &Ctx) | |
Use | getOperandUseDefault (unsigned OpIdx, bool Verify) const |
\Returns the Use edge that corresponds to OpIdx . | |
virtual Use | getOperandUseInternal (unsigned OpIdx, bool Verify) const =0 |
\Returns the Use for the OpIdx'th operand. | |
unsigned | getUseOperandNoDefault (const Use &Use) const |
The default implementation works only for single-LLVMIR-instruction Users and only if they match exactly the LLVM instruction. | |
virtual unsigned | getUseOperandNo (const Use &Use) const =0 |
\Returns the operand index of Use . | |
void | swapOperandsInternal (unsigned OpIdxA, unsigned OpIdxB) |
void | verifyUserOfLLVMUse (const llvm::Use &Use) const |
Protected Member Functions inherited from llvm::sandboxir::Value | |
void | clearValue () |
Value (ClassID SubclassID, llvm::Value *Val, Context &Ctx) | |
Value (const Value &)=delete | |
Disable copies. | |
Value & | operator= (const Value &)=delete |
Friends | |
class | OperandUseIterator |
unsigned | Use::getOperandNo () const |
Additional Inherited Members | |
Static Protected Member Functions inherited from llvm::sandboxir::Value | |
static const char * | getSubclassIDStr (ClassID ID) |
Protected Attributes inherited from llvm::sandboxir::Value | |
ClassID | SubclassID |
For isa/dyn_cast. | |
unsigned | UID |
A unique ID used for forming the name (used for debugging). | |
llvm::Value * | Val = nullptr |
The LLVM Value that corresponds to this SandboxIR Value. | |
Context & | Ctx |
All values point to the context. | |
A sandboxir::User has operands.
|
inlineprotected |
|
finalvirtual |
Reimplemented from llvm::sandboxir::Value.
Definition at line 112 of file User.cpp.
References llvm::sandboxir::Value::dumpCommonHeader(), and OS.
|
inlineoverridevirtual |
Implements llvm::sandboxir::Value.
Reimplemented in llvm::sandboxir::SingleLLVMInstructionImpl< llvm::AtomicCmpXchgInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::AtomicRMWInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::BinaryOperator >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::BranchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CallBase >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CatchReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CatchSwitchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CleanupReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CmpInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ExtractElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::FenceInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::FuncletPadInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::GetElementPtrInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertValueInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::LandingPadInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::Instruction >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ResumeInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SelectInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ShuffleVectorInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::StoreInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SwitchInst >, and llvm::sandboxir::SingleLLVMInstructionImpl< llvm::UnaryInstruction >.
|
inlinevirtual |
Definition at line 128 of file User.h.
References llvm::sandboxir::Value::Val.
Referenced by llvm::User::getDescriptor(), llvm::sandboxir::CatchSwitchInst::getNumSuccessors(), getOperandUseDefault(), op_end(), llvm::sandboxir::PHINode::replaceIncomingBlockWith(), and swapOperandsInternal().
Definition at line 122 of file User.h.
References llvm::sandboxir::Use::get(), and getOperandUse().
\Returns the operand edge for OpIdx
.
NOTE: This should also work for OpIdx == getNumOperands(), which is used for op_end().
Definition at line 125 of file User.h.
References getOperandUseInternal().
Referenced by llvm::sandboxir::ShuffleVectorInst::commute(), llvm::sandboxir::CallBase::getArgOperandUse(), llvm::User::getDescriptor(), getOperand(), setOperand(), swapOperandsInternal(), and llvm::sandboxir::SelectInst::swapValues().
\Returns the Use edge that corresponds to OpIdx
.
Note: This is the default implementation that works for instructions that match the underlying LLVM instruction. All others should use a different implementation.
Definition at line 58 of file User.cpp.
References assert(), llvm::sandboxir::Value::Ctx, getNumOperands(), llvm::sandboxir::Value::Use, llvm::sandboxir::Value::Val, and Verify.
Referenced by llvm::sandboxir::GlobalObject::getOperandUseInternal(), and llvm::sandboxir::Constant::getOperandUseInternal().
|
protectedpure virtual |
\Returns the Use for the OpIdx'th
operand.
This is virtual to allow instructions to deviate from the LLVM IR operands, which is a requirement for sandboxir Instructions that consist of more than one LLVM Instruction.
Implemented in llvm::sandboxir::GlobalObject, and llvm::sandboxir::Constant.
Referenced by getOperandUse(), op_begin(), op_end(), llvm::sandboxir::OperandUseIterator::operator+(), llvm::sandboxir::OperandUseIterator::operator++(), and llvm::sandboxir::OperandUseIterator::operator-().
|
protectedpure virtual |
\Returns the operand index of Use
.
Implemented in llvm::sandboxir::ConstantFP, llvm::sandboxir::ConstantAggregateZero, llvm::sandboxir::ConstantPointerNull, llvm::sandboxir::UndefValue, llvm::sandboxir::GlobalObject, llvm::sandboxir::NoCFIValue, llvm::sandboxir::DSOLocalEquivalent, llvm::sandboxir::ConstantTokenNone, llvm::sandboxir::SingleLLVMInstructionImpl< LLVMT >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::AtomicCmpXchgInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::AtomicRMWInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::BinaryOperator >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::BranchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CallBase >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CatchReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CatchSwitchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CleanupReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CmpInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ExtractElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::FenceInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::FuncletPadInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::GetElementPtrInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertValueInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::LandingPadInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::Instruction >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ResumeInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SelectInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ShuffleVectorInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::StoreInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SwitchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::UnaryInstruction >, llvm::sandboxir::UnreachableInst, llvm::sandboxir::Constant, and llvm::sandboxir::ConstantInt.
Referenced by llvm::sandboxir::Use::getOperandNo().
The default implementation works only for single-LLVMIR-instruction Users and only if they match exactly the LLVM instruction.
Definition at line 75 of file User.h.
Referenced by llvm::sandboxir::GlobalObject::getUseOperandNo(), llvm::sandboxir::NoCFIValue::getUseOperandNo(), llvm::sandboxir::SingleLLVMInstructionImpl< LLVMT >::getUseOperandNo(), and llvm::sandboxir::Constant::getUseOperandNo().
|
inlinevirtual |
Definition at line 102 of file User.h.
References assert(), getOperandUseInternal(), and llvm::sandboxir::Value::Val.
Referenced by llvm::sandboxir::CallBase::arg_begin(), llvm::sandboxir::CallBase::data_operands_begin(), llvm::sandboxir::CallBase::data_operands_end(), llvm::sandboxir::CatchSwitchInst::handler_begin(), llvm::sandboxir::GetElementPtrInst::idx_begin(), op_begin(), operands(), llvm::sandboxir::DGNode::preds_begin(), and llvm::sandboxir::MemDGNode::preds_begin().
|
inlinevirtual |
Definition at line 111 of file User.h.
References op_begin().
|
inlinevirtual |
Definition at line 106 of file User.h.
References assert(), getNumOperands(), getOperandUseInternal(), and llvm::sandboxir::Value::Val.
Referenced by llvm::sandboxir::CatchSwitchInst::handler_end(), llvm::sandboxir::GetElementPtrInst::idx_end(), op_end(), operands(), llvm::sandboxir::DGNode::preds_begin(), llvm::sandboxir::MemDGNode::preds_begin(), llvm::sandboxir::DGNode::preds_end(), and llvm::sandboxir::MemDGNode::preds_end().
|
inlinevirtual |
|
inline |
Definition at line 118 of file User.h.
References op_begin(), and op_end().
Referenced by llvm::sandboxir::PHINode::incoming_values().
|
inline |
Definition at line 119 of file User.h.
References op_begin(), and op_end().
Definition at line 91 of file User.cpp.
References assert(), llvm::sandboxir::Value::Ctx, llvm::sandboxir::Tracker::emplaceIfTracking(), getOperandUse(), llvm::sandboxir::Context::getTracker(), and llvm::sandboxir::Value::Val.
Referenced by llvm::sandboxir::CallBase::setArgOperand(), llvm::sandboxir::SelectInst::setCondition(), llvm::sandboxir::BranchInst::setCondition(), llvm::sandboxir::SelectInst::setFalseValue(), llvm::sandboxir::InvokeInst::setNormalDest(), llvm::sandboxir::BranchInst::setSuccessor(), llvm::sandboxir::CatchSwitchInst::setSuccessor(), llvm::sandboxir::SelectInst::setTrueValue(), and llvm::sandboxir::InvokeInst::setUnwindDest().
|
inlineprotected |
Definition at line 82 of file User.h.
References assert(), getNumOperands(), and getOperandUse().
Referenced by llvm::sandboxir::BinaryOperator::swapOperands(), and llvm::sandboxir::BranchInst::swapSuccessors().
|
inlineoverridevirtual |
Should crash if there is something wrong with the instruction.
Implements llvm::sandboxir::Value.
Reimplemented in llvm::sandboxir::SingleLLVMInstructionImpl< llvm::AtomicCmpXchgInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::AtomicRMWInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::BinaryOperator >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::BranchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CallBase >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CatchReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CatchSwitchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CleanupReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::CmpInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ExtractElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::FenceInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::FuncletPadInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::GetElementPtrInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertValueInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::LandingPadInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::Instruction >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ResumeInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SelectInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ShuffleVectorInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::StoreInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SwitchInst >, and llvm::sandboxir::SingleLLVMInstructionImpl< llvm::UnaryInstruction >.
Definition at line 138 of file User.h.
References assert(), and llvm::sandboxir::Value::Val.
Definition at line 70 of file User.cpp.
References assert(), llvm::sandboxir::Value::Ctx, llvm::sandboxir::Use::getUser(), and llvm::sandboxir::Context::getValue().
|
friend |
|
friend |