LLVM 19.0.0git
|
A SandboxIR Value has users. This is the base class. More...
#include "llvm/SandboxIR/SandboxIR.h"
Classes | |
struct | UseToUser |
Helper for mapped_iterator. More... | |
Public Types | |
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 |
Protected Member Functions | |
void | clearValue () |
Value (ClassID SubclassID, llvm::Value *Val, Context &Ctx) | |
Static Protected Member Functions | |
static const char * | getSubclassIDStr (ClassID ID) |
Protected Attributes | |
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. | |
Friends | |
class | Context |
class | User |
template<typename ItTy , typename SBTy > | |
class | LLVMOpUserItToSBTy |
raw_ostream & | operator<< (raw_ostream &OS, const sandboxir::Value &V) |
A SandboxIR Value has users. This is the base class.
Definition at line 166 of file SandboxIR.h.
Definition at line 218 of file SandboxIR.h.
Definition at line 242 of file SandboxIR.h.
Definition at line 217 of file SandboxIR.h.
using llvm::sandboxir::Value::user_iterator = mapped_iterator<sandboxir::UserUseIterator, UseToUser> |
Definition at line 241 of file SandboxIR.h.
|
strong |
Enumerator | |
---|---|
DEF_VALUE | |
DEF_USER | |
DEF_INSTR |
Definition at line 168 of file SandboxIR.h.
|
protected |
Definition at line 76 of file SandboxIR.cpp.
References Ctx, llvm::sandboxir::Context::getNumValues(), and UID.
|
virtualdefault |
|
inlineprotected |
Definition at line 208 of file SandboxIR.h.
References Val.
|
pure virtual |
|
pure virtual |
void Value::dumpCommonFooter | ( | raw_ostream & | OS | ) | const |
Definition at line 136 of file SandboxIR.cpp.
|
virtual |
Reimplemented in llvm::sandboxir::User.
Definition at line 132 of file SandboxIR.cpp.
References getName(), getSubclassIDStr(), OS, and SubclassID.
Referenced by llvm::sandboxir::User::dumpCommonHeader().
void Value::dumpCommonPrefix | ( | raw_ostream & | OS | ) | const |
Definition at line 145 of file SandboxIR.cpp.
Referenced by llvm::sandboxir::Argument::dump(), llvm::sandboxir::Constant::dump(), and llvm::sandboxir::OpaqueInst::dump().
void Value::dumpCommonSuffix | ( | raw_ostream & | OS | ) | const |
Definition at line 152 of file SandboxIR.cpp.
References getName(), getSubclassIDStr(), OS, and SubclassID.
Referenced by llvm::sandboxir::Argument::dump(), llvm::sandboxir::Constant::dump(), and llvm::sandboxir::OpaqueInst::dump().
|
inline |
Definition at line 287 of file SandboxIR.h.
References Ctx.
Referenced by llvm::sandboxir::Constant::getParent().
std::string Value::getName | ( | ) | const |
Returns the name in the form 'SB<number>.' like 'SB1.'.
Definition at line 126 of file SandboxIR.cpp.
References UID.
Referenced by dumpCommonHeader(), and dumpCommonSuffix().
unsigned Value::getNumUses | ( | ) | const |
\Returns the number of user edges (not necessarily to unique users).
WARNING: This is a linear-time operation.
Definition at line 104 of file SandboxIR.cpp.
References llvm::range_size(), llvm::Value::users(), and Val.
|
inline |
Definition at line 215 of file SandboxIR.h.
References SubclassID.
Definition at line 176 of file SandboxIR.h.
References llvm_unreachable.
Referenced by dumpCommonHeader(), and dumpCommonSuffix().
|
inline |
Definition at line 285 of file SandboxIR.h.
References llvm::Value::getType(), and Val.
Referenced by replaceAllUsesWith(), and replaceUsesWithIf().
Return true if this Value has exactly N uses.
Definition at line 276 of file SandboxIR.h.
References use_begin(), and use_end().
Return true if this value has N uses or more.
This is logically equivalent to getNumUses() >= N. WARNING: This can be expensive, as it is linear to the number of users.
Definition at line 267 of file SandboxIR.h.
References use_begin(), and use_end().
void Value::printAsOperandCommon | ( | raw_ostream & | OS | ) | const |
Definition at line 156 of file SandboxIR.cpp.
References OS, llvm::Value::printAsOperand(), and Val.
Referenced by llvm::sandboxir::Argument::printAsOperand().
void Value::replaceAllUsesWith | ( | Value * | Other | ) |
Definition at line 119 of file SandboxIR.cpp.
References assert(), getType(), llvm::Other, llvm::Value::replaceAllUsesWith(), and Val.
void Value::replaceUsesWithIf | ( | Value * | OtherV, |
llvm::function_ref< bool(const Use &)> | ShouldReplace | ||
) |
Definition at line 106 of file SandboxIR.cpp.
References assert(), Ctx, getType(), llvm::Use::getUser(), llvm::sandboxir::Context::getValue(), llvm::Value::replaceUsesWithIf(), and Val.
Value::use_iterator Value::use_begin | ( | ) |
Definition at line 83 of file SandboxIR.cpp.
References Ctx, llvm::sandboxir::Context::getValue(), llvm::Value::use_begin(), llvm::Value::use_end(), and Val.
Referenced by hasNUses(), hasNUsesOrMore(), use_begin(), and uses().
|
inline |
Definition at line 221 of file SandboxIR.h.
References use_begin().
|
inline |
Definition at line 224 of file SandboxIR.h.
References Ctx.
Referenced by hasNUses(), hasNUsesOrMore(), use_end(), and uses().
|
inline |
Definition at line 225 of file SandboxIR.h.
References use_end().
Value::user_iterator Value::user_begin | ( | ) |
Definition at line 93 of file SandboxIR.cpp.
References Ctx, llvm::sandboxir::Context::getValue(), llvm::Value::use_begin(), llvm::Value::use_end(), and Val.
Referenced by user_begin(), and users().
|
inline |
Definition at line 248 of file SandboxIR.h.
References user_begin().
|
inline |
|
inline |
Definition at line 251 of file SandboxIR.h.
References user_end().
|
inline |
Definition at line 255 of file SandboxIR.h.
References user_begin(), and user_end().
|
inline |
Definition at line 258 of file SandboxIR.h.
References user_begin(), and user_end().
|
inline |
Definition at line 229 of file SandboxIR.h.
References use_begin(), and use_end().
|
inline |
Definition at line 232 of file SandboxIR.h.
References use_begin(), and use_end().
|
pure virtual |
Should crash if there is something wrong with the instruction.
Implemented in llvm::sandboxir::Argument, llvm::sandboxir::Constant, llvm::sandboxir::OpaqueInst, llvm::sandboxir::BasicBlock, llvm::sandboxir::Function, and llvm::sandboxir::User.
|
friend |
Definition at line 202 of file SandboxIR.h.
|
friend |
Definition at line 209 of file SandboxIR.h.
|
friend |
Definition at line 303 of file SandboxIR.h.
|
friend |
Definition at line 203 of file SandboxIR.h.
|
protected |
All values point to the context.
Definition at line 206 of file SandboxIR.h.
Referenced by llvm::sandboxir::BasicBlock::begin(), llvm::sandboxir::Function::begin(), llvm::sandboxir::BasicBlock::dump(), llvm::sandboxir::Function::dump(), llvm::sandboxir::BasicBlock::end(), llvm::sandboxir::Function::end(), llvm::sandboxir::Function::getArg(), getContext(), llvm::sandboxir::BasicBlock::getContext(), llvm::sandboxir::User::getOperandUseDefault(), llvm::sandboxir::BasicBlock::getParent(), llvm::sandboxir::BasicBlock::getTerminator(), replaceUsesWithIf(), use_begin(), use_end(), user_begin(), user_end(), Value(), and llvm::sandboxir::User::verifyUserOfLLVMUse().
|
protected |
For isa/dyn_cast.
Definition at line 193 of file SandboxIR.h.
Referenced by dumpCommonHeader(), dumpCommonSuffix(), and getSubclassID().
|
protected |
A unique ID used for forming the name (used for debugging).
Definition at line 196 of file SandboxIR.h.
|
protected |
The LLVM Value that corresponds to this SandboxIR Value.
NOTE: Some SBInstructions, like Packs, may include more than one value.
Definition at line 200 of file SandboxIR.h.
Referenced by llvm::sandboxir::Function::arg_empty(), llvm::sandboxir::Function::arg_size(), llvm::sandboxir::BasicBlock::back(), llvm::sandboxir::BasicBlock::begin(), llvm::sandboxir::Function::begin(), clearValue(), llvm::sandboxir::BasicBlock::dump(), llvm::sandboxir::Function::dump(), dumpCommonFooter(), dumpCommonPrefix(), llvm::sandboxir::Function::dumpNameAndArgs(), llvm::sandboxir::BasicBlock::end(), llvm::sandboxir::Function::end(), llvm::sandboxir::BasicBlock::front(), llvm::sandboxir::Function::getArg(), llvm::sandboxir::User::getNumOperands(), getNumUses(), llvm::sandboxir::User::getOperandUseDefault(), llvm::sandboxir::BasicBlock::getParent(), llvm::sandboxir::BasicBlock::getTerminator(), getType(), llvm::sandboxir::User::op_begin(), llvm::sandboxir::User::op_end(), printAsOperandCommon(), replaceAllUsesWith(), llvm::sandboxir::User::replaceUsesOfWith(), replaceUsesWithIf(), llvm::sandboxir::User::setOperand(), use_begin(), user_begin(), llvm::sandboxir::Argument::verify(), llvm::sandboxir::Constant::verify(), llvm::sandboxir::BasicBlock::verify(), llvm::sandboxir::Function::verify(), and llvm::sandboxir::User::verify().