LLVM 20.0.0git
|
A sandboxir::User has operands. More...
#include "llvm/SandboxIR/SandboxIR.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_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.
Definition at line 400 of file SandboxIR.h.
Definition at line 440 of file SandboxIR.h.
Definition at line 442 of file SandboxIR.h.
Definition at line 439 of file SandboxIR.h.
Definition at line 441 of file SandboxIR.h.
|
inlineprotected |
Definition at line 402 of file SandboxIR.h.
|
finalvirtual |
Reimplemented from llvm::sandboxir::Value.
Definition at line 274 of file SandboxIR.cpp.
References llvm::sandboxir::Value::dumpCommonHeader(), and OS.
|
inlineoverridevirtual |
Implements llvm::sandboxir::Value.
Reimplemented in llvm::sandboxir::Function, llvm::sandboxir::Constant, llvm::sandboxir::ConstantInt, llvm::sandboxir::Instruction, 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::ExtractElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::GetElementPtrInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::Instruction >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SelectInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::StoreInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SwitchInst >, and llvm::sandboxir::SingleLLVMInstructionImpl< llvm::UnaryInstruction >.
Definition at line 484 of file SandboxIR.h.
|
inlinevirtual |
Definition at line 470 of file SandboxIR.h.
References llvm::sandboxir::Value::Val.
Referenced by getOperandUseDefault(), op_end(), llvm::sandboxir::PHINode::replaceIncomingBlockWith(), replaceUsesOfWith(), and swapOperandsInternal().
Definition at line 464 of file SandboxIR.h.
References llvm::sandboxir::Use::get(), and getOperandUse().
Referenced by llvm::sandboxir::CallBase::getArgOperand(), llvm::sandboxir::SelectInst::getCondition(), llvm::sandboxir::SelectInst::getFalseValue(), llvm::sandboxir::ExtractElementInst::getIndexOperand(), llvm::sandboxir::AddrSpaceCastInst::getPointerOperand(), llvm::sandboxir::SelectInst::getTrueValue(), and llvm::sandboxir::ExtractElementInst::getVectorOperand().
\Returns the operand edge for OpIdx
.
NOTE: This should also work for OpIdx == getNumOperands(), which is used for op_end().
Definition at line 467 of file SandboxIR.h.
References getOperandUseInternal().
Referenced by llvm::sandboxir::CallBase::getArgOperandUse(), getOperand(), replaceUsesOfWith(), setOperand(), and swapOperandsInternal().
\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 220 of file SandboxIR.cpp.
References assert(), llvm::sandboxir::Value::Ctx, getNumOperands(), llvm::sandboxir::Value::Use, llvm::sandboxir::Value::Val, and Verify.
|
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.
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::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::ExtractElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::GetElementPtrInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::Instruction >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SelectInst >, 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 417 of file SandboxIR.h.
Referenced by llvm::sandboxir::SingleLLVMInstructionImpl< LLVMT >::getUseOperandNo(), and llvm::sandboxir::Constant::getUseOperandNo().
|
inlinevirtual |
Definition at line 444 of file SandboxIR.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::GetElementPtrInst::idx_begin(), op_begin(), and operands().
|
inlinevirtual |
Definition at line 453 of file SandboxIR.h.
References op_begin().
|
inlinevirtual |
Definition at line 448 of file SandboxIR.h.
References assert(), getNumOperands(), getOperandUseInternal(), and llvm::sandboxir::Value::Val.
Referenced by llvm::sandboxir::GetElementPtrInst::idx_end(), op_end(), and operands().
|
inlinevirtual |
Definition at line 456 of file SandboxIR.h.
References op_end().
|
inline |
Definition at line 460 of file SandboxIR.h.
References op_begin(), and op_end().
Referenced by llvm::sandboxir::PHINode::incoming_values().
|
inline |
Definition at line 461 of file SandboxIR.h.
References op_begin(), and op_end().
Replaces any operands that match FromV
with ToV
.
Returns whether any operands were replaced.
Definition at line 260 of file SandboxIR.cpp.
References llvm::sandboxir::Value::Ctx, llvm::sandboxir::Tracker::emplaceIfTracking(), llvm::sandboxir::Use::get(), getNumOperands(), getOperandUse(), llvm::sandboxir::Context::getTracker(), llvm::sandboxir::Tracker::isTracking(), llvm::sandboxir::Value::Use, and llvm::sandboxir::Value::Val.
Definition at line 253 of file SandboxIR.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::SelectInst::setTrueValue(), and llvm::sandboxir::InvokeInst::setUnwindDest().
|
inlineprotected |
Definition at line 424 of file SandboxIR.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< 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::ExtractElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::GetElementPtrInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::InsertElementInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::Instruction >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::PHINode >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::ReturnInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SelectInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::StoreInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::SwitchInst >, llvm::sandboxir::SingleLLVMInstructionImpl< llvm::UnaryInstruction >, llvm::sandboxir::Function, llvm::sandboxir::Constant, and llvm::sandboxir::ConstantInt.
Definition at line 480 of file SandboxIR.h.
References assert(), and llvm::sandboxir::Value::Val.
Definition at line 232 of file SandboxIR.cpp.
References assert(), llvm::sandboxir::Value::Ctx, llvm::sandboxir::Use::getUser(), and llvm::sandboxir::Context::getValue().
|
friend |
Definition at line 413 of file SandboxIR.h.
|
friend |