LLVM API Documentation
#include <Value.h>
Inheritance diagram for llvm::Value:
Definition at line 44 of file Value.h.
typedef value_use_iterator<const User> llvm::Value::use_const_iterator |
enum llvm::Value::ValueTy |
getValueType - Return an ID for the concrete type of this object. This is used to implement the classof checks. This should not be used for any other purpose, as the values may change as LLVM evolves. Also, note that starting with the InstructionVal value, the value stored is actually the Instruction opcode, so there are more than just these values possible here (and Instruction must be last).
Value::Value | ( | const Type * | Ty, | |
unsigned | scid, | |||
const std::string & | name = "" | |||
) |
Value::~Value | ( | ) | [virtual] |
Definition at line 44 of file Value.cpp.
References E, I, llvm::LeakDetector::removeGarbageObject(), use_begin(), and use_end().
void llvm::Value::addUse | ( | Use & | U | ) | [inline] |
addUse/killUse - These two methods should only be used by the Use class.
Definition at line 134 of file Value.h.
References U.
Referenced by llvm::Use::init().
static bool llvm::Value::classof | ( | const Value * | ) | [inline, static] |
Reimplemented in llvm::Argument, llvm::BasicBlock, llvm::Constant, llvm::ConstantIntegral, llvm::ConstantBool, llvm::ConstantInt, llvm::ConstantSInt, llvm::ConstantUInt, llvm::ConstantFP, llvm::ConstantAggregateZero, llvm::ConstantArray, llvm::ConstantStruct, llvm::ConstantPacked, llvm::ConstantPointerNull, llvm::ConstantExpr, llvm::UndefValue, llvm::Function, llvm::GlobalValue, llvm::GlobalVariable, llvm::InlineAsm, llvm::TerminatorInst, llvm::BinaryOperator, llvm::Instruction, llvm::AllocationInst, llvm::MallocInst, llvm::AllocaInst, llvm::FreeInst, llvm::LoadInst, llvm::StoreInst, llvm::GetElementPtrInst, llvm::SetCondInst, llvm::CastInst, llvm::CallInst, llvm::ShiftInst, llvm::SelectInst, llvm::VAArgInst, llvm::ExtractElementInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, llvm::PHINode, llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, llvm::UnreachableInst, llvm::IntrinsicInst, llvm::DbgInfoIntrinsic, llvm::DbgStopPointInst, llvm::DbgFuncStartInst, llvm::DbgRegionStartInst, llvm::DbgRegionEndInst, llvm::DbgDeclareInst, llvm::MemIntrinsic, llvm::MemCpyInst, llvm::MemMoveInst, llvm::MemSetInst, llvm::User, llvm::TmpInstruction, and llvm::ValueHandle.
void Value::dump | ( | ) | const [virtual] |
dump - Support for debugging, callable in GDB: V->dump()
Definition at line 1334 of file AsmWriter.cpp.
References print().
const std::string& llvm::Value::getName | ( | ) | const [inline] |
Definition at line 80 of file Value.h.
References Name.
Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), BreakUpSubtract(), llvm::CloneBasicBlock(), llvm::ConvertExpressionToType(), ConvertOperandToType(), ConvertShiftToMul(), llvm::DecomposeArrayRef(), llvm::DemoteRegToStack(), llvm::SDNode::dump(), llvm::SchedGraphSet::dump(), llvm::SchedGraph::dump(), EmitGEPOffset(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), EvaluateFunction(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), ForceRenaming(), getArgumentPermutation(), getGlobalVariableClass(), llvm::Function::getIntrinsicID(), llvm::JIT::getOrEmitGlobalVariable(), getSCEVStartAndStride(), HandleInlinedInvoke(), HoistThenElseCodeToIf(), InlineCallIfPossible(), llvm::InlineFunction(), llvm::SymbolTable::insert(), InsertInstrumentationCall(), InstallGlobalCtors(), InstCombineLoadCast(), InstCombineStoreToCast(), LinkGlobals(), llvm::DefaultIntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), SCCPSolver::MarkBlockExecutable(), NegateValue(), llvm::operator<<(), OptimizeGlobalAddressOfMalloc(), OutputValue(), llvm::BytecodeReader::ParseConstantPool(), llvm::SCEVAddRecExpr::print(), llvm::MachineFunction::print(), llvm::MachineBasicBlock::print(), printCollection(), PrintLoopInfo(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), llvm::PMDebug::PrintPassInformation(), ProcessGlobalsWithSameName(), llvm::SymbolTable::remove(), ReplaceCallWith(), llvm::ReplaceInstWithValue(), ResolveFunctions(), llvm::SelectionDAGISel::runOnFunction(), llvm::SparcV9CodeEmitter::runOnMachineFunction(), ShrinkGlobalToBoolean(), llvm::SimplifyCFG(), llvm::SplitCriticalEdge(), SRAGlobal(), TryToSimplifyUncondBranchFromEmptyBlock(), llvm::UpgradeIntrinsicCall(), llvm::MachineFunction::viewCFG(), and llvm::Function::viewCFG().
unsigned Value::getNumUses | ( | ) | const |
getNumUses - This method computes the number of uses of this Value. This is a linear time operation. Use hasOneUse, hasNUses, or hasMoreThanNUses to check for specific values.
Definition at line 91 of file Value.cpp.
References use_begin(), and use_end().
Referenced by llvm::ConvertExpressionToType(), and ResolveFunctions().
const Type* llvm::Value::getRawType | ( | ) | const [inline] |
const Type* llvm::Value::getType | ( | ) | const [inline] |
All values are typed, get the type of this value.
Reimplemented in llvm::ConstantArray, llvm::ConstantStruct, llvm::ConstantPacked, llvm::ConstantPointerNull, llvm::GlobalValue, llvm::InlineAsm, llvm::AllocationInst, and llvm::GetElementPtrInst.
Definition at line 76 of file Value.h.
References Ty.
Referenced by llvm::AliasSetTracker::add(), llvm::PHINode::addIncoming(), llvm::DSGraph::addObjectToGraph(), AddWithOverflow(), AssociativeOpt(), CallPassesValueThoughVararg(), CastConstantPacked(), Coerce(), ComputeMaskedBits(), llvm::SparcV9FunctionInfo::computeOffsetforLocalVar(), llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldInstruction(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::ConstantRange::ConstantRange(), llvm::ConvertExpressionToType(), ConvertOperandToType(), ConvertShiftToMul(), llvm::BinaryOperator::create(), llvm::DecomposeArrayRef(), DecomposeConstantExpr(), DecomposeSimpleLinearExpr(), llvm::DemoteRegToStack(), llvm::AsmPrinter::EmitConstantPool(), llvm::AsmPrinter::EmitGlobalConstant(), EvaluateFunction(), evaluateRelation(), EvaluateStoreInto(), llvm::Interpreter::executeGEPOperation(), llvm::ExpressionConvertibleToType(), FoldCondBranchOnPHI(), FoldOpIntoSelect(), FoldTwoEntryPHINode(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), GatherConstantSetNEs(), llvm::gep_type_begin(), llvm::SCEVSDivExpr::get(), llvm::SCEVConstant::get(), llvm::ConstantExpr::get(), getAISize(), llvm::DSGraph::getDSCallSiteForCallSite(), llvm::ConstantExpr::getExtractElement(), GetFactor(), llvm::ConstantExpr::getInsertElement(), GetKnownAlignment(), llvm::AliasAnalysis::getModRefInfo(), llvm::CallArgsDescriptor::getReturnValue(), llvm::ConstantExpr::getSelect(), GetSelectFoldableConstant(), llvm::ConstantExpr::getSelectTy(), llvm::ConstantIntegral::getSExtValue(), llvm::ConstantExpr::getShiftTy(), llvm::ConstantExpr::getSShr(), llvm::DISerializer::getString(), getStringRef(), llvm::ConstantExpr::getTy(), llvm::SCEVUnknown::getType(), llvm::SCEVConstant::getType(), llvm::GetElementPtrInst::getType(), llvm::AllocationInst::getType(), llvm::InlineAsm::getType(), llvm::GlobalValue::getType(), llvm::ConstantPointerNull::getType(), llvm::ConstantPacked::getType(), llvm::ConstantStruct::getType(), llvm::ConstantArray::getType(), llvm::ConstantRange::getType(), llvm::CallSite::getType(), llvm::ConstantExpr::getUShr(), llvm::ConstantIntegral::getZExtValue(), llvm::GlobalVariable::GlobalVariable(), llvm::PHINode::hasConstantValue(), HoistThenElseCodeToIf(), IdenticalComplexInst(), llvm::BinaryOperator::init(), llvm::ExecutionEngine::InitializeMemory(), llvm::SymbolTable::insert(), InsertGEPComputeCode(), llvm::InsertProfilingInitCall(), InstallGlobalCtors(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::ConstantUInt::isAllOnesValue(), llvm::Instruction::isAssociative(), isHighOnes(), llvm::Instruction::isIdenticalTo(), llvm::ConstantSInt::isMaxValue(), llvm::ConstantSInt::isMinValue(), isReinterpretingCast(), isSignBit(), isSignBitCheck(), llvm::ShuffleVectorInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ExtractElementInst::isValidOperands(), llvm::isVarArgsCall(), llvm::TargetLowering::LowerArguments(), LowerCTPOP(), llvm::DefaultIntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), Next(), OperandConvertibleToType(), OptimizeAwayTrappingUsesOfValue(), OptimizeGEPExpression(), llvm::BytecodeReader::ParseConstantPool(), llvm::BytecodeReader::ParseConstantPoolValue(), llvm::BytecodeReader::ParseInstruction(), PartialFact(), llvm::Constant::print(), llvm::SymbolTable::remove(), llvm::AliasSetTracker::remove(), llvm::PHINode::removeIncomingValue(), RemoveNoopCast(), replaceAllUsesWith(), ReplaceCallWith(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), SCCPSolver::ResolveBranchesIn(), llvm::JIT::runFunction(), llvm::MemIntrinsic::setAlignment(), llvm::MemIntrinsic::setDest(), llvm::MemIntrinsic::setLength(), llvm::MemMoveInst::setSource(), llvm::MemCpyInst::setSource(), llvm::MemSetInst::setValue(), ShouldTraceValue(), ShrinkDemandedConstant(), ShrinkGlobalToBoolean(), SolveQuadraticEquation(), llvm::ConstantRange::subtract(), llvm::UpgradeIntrinsicCall(), ValuesEqual(), llvm::SelectionDAGLowering::visitBinary(), llvm::Interpreter::visitBinaryOperator(), llvm::SelectionDAGLowering::visitCall(), llvm::SelectionDAGLowering::visitCast(), llvm::Interpreter::visitCastInst(), llvm::SelectionDAGLowering::visitExtractElement(), llvm::Interpreter::visitFreeInst(), llvm::SelectionDAGLowering::visitGetElementPtr(), llvm::SelectionDAGLowering::visitInlineAsm(), llvm::SelectionDAGLowering::visitLoad(), llvm::Interpreter::visitLoadInst(), llvm::Interpreter::visitReturnInst(), llvm::SelectionDAGLowering::visitSelect(), llvm::SelectionDAGLowering::visitSetCC(), llvm::Interpreter::visitShl(), llvm::Interpreter::visitShr(), llvm::Interpreter::visitStoreInst(), llvm::SelectionDAGLowering::visitSub(), llvm::Interpreter::visitSwitchInst(), llvm::SelectionDAGLowering::visitTargetIntrinsic(), llvm::SelectionDAGLowering::visitUserOp2(), llvm::SelectionDAGLowering::visitVAArg(), llvm::Interpreter::visitVAArgInst(), WriteConstantInt(), and llvm::ConstantRange::zeroExtend().
unsigned llvm::Value::getValueType | ( | ) | const [inline] |
Definition at line 166 of file Value.h.
Referenced by llvm::Instruction::getOpcode(), llvm::IA64TargetLowering::LowerCallTo(), llvm::AlphaTargetLowering::LowerOperation(), and llvm::PPCTargetLowering::PerformDAGCombine().
bool llvm::Value::hasName | ( | ) | const [inline] |
Definition at line 79 of file Value.h.
References Name.
Referenced by llvm::CloneBasicBlock(), llvm::SymbolTable::insert(), maybeAddInternalValueToVector(), llvm::operator<<(), OutputValue(), llvm::SymbolTable::remove(), setName(), llvm::SimplifyCFG(), and TryToSimplifyUncondBranchFromEmptyBlock().
bool Value::hasNUses | ( | unsigned | N | ) | const |
bool Value::hasNUsesOrMore | ( | unsigned | N | ) | const |
hasNUsesOrMore - Return true if this value has N users or more. This is logically equivalent to getNumUses() >= N.
Definition at line 78 of file Value.cpp.
References E, use_begin(), and use_end().
Referenced by llvm::BasicBlock::removePredecessor(), and SRAGlobal().
bool llvm::Value::hasOneUse | ( | ) | const [inline] |
hasOneUse - Return true if there is exactly one user of this value. This is specialized because it is a common request and does not require traversing the whole use list.
Definition at line 112 of file Value.h.
References E, I, use_begin(), and use_end().
Referenced by AssociativeOpt(), BreakUpSubtract(), CheapToScalarize(), ConvertShiftToMul(), DeadPHICycle(), FoldCondBranchOnPHI(), FoldOpIntoSelect(), isBlockSimpleEnough(), NegateValue(), llvm::TargetLowering::SimplifyDemandedBits(), and TryToSinkInstruction().
virtual void llvm::Value::print | ( | std::ostream & | O | ) | const [pure virtual] |
print - Implement operator<< on Value...
Implemented in llvm::Argument, llvm::BasicBlock, llvm::Constant, llvm::Function, llvm::GlobalVariable, llvm::InlineAsm, llvm::Instruction, and llvm::BytecodeReader::ValueList.
Referenced by dump(), and llvm::BytecodeReader::ValueList::print().
void Value::replaceAllUsesWith | ( | Value * | V | ) |
replaceAllUsesWith - Go through the uses list for this definition and make each use point to "V" instead of "this". After this completes, 'this's use list is guaranteed to be empty.
Definition at line 153 of file Value.cpp.
References getType(), and uncheckedReplaceAllUsesWith().
Referenced by AssociativeOpt(), BreakUpSubtract(), ConvertShiftToMul(), llvm::DecomposeArrayRef(), FindPHIToPartitionLoops(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), HandleInlinedInvoke(), HoistThenElseCodeToIf(), llvm::InlineFunction(), InstallGlobalCtors(), LinkAppendingVars(), LinkGlobals(), llvm::DefaultIntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), OptimizeGlobalAddressOfMalloc(), llvm::BytecodeReader::ParseFunctionBody(), llvm::PHINode::removeIncomingValue(), llvm::BasicBlock::removePredecessor(), ReplaceCallWith(), llvm::ReplaceInstWithValue(), ReplaceUsesOfWith(), ResolveFunctions(), llvm::SimplifyCFG(), SRAGlobal(), TryToSimplifyUncondBranchFromEmptyBlock(), and llvm::UpgradeIntrinsicCall().
void Value::setName | ( | const std::string & | name | ) |
Definition at line 96 of file Value.cpp.
References A, BB, llvm::SymbolTable::changeName(), llvm::GlobalValue::getParent(), llvm::BasicBlock::getParent(), GV, hasName(), I, llvm::SymbolTable::insert(), and llvm::SymbolTable::remove().
Referenced by BreakUpSubtract(), llvm::CloneBasicBlock(), llvm::ConvertExpressionToType(), ConvertOperandToType(), ConvertShiftToMul(), FoldCondBranchOnPHI(), FoldTwoEntryPHINode(), ForceRenaming(), getBBVal(), HoistThenElseCodeToIf(), InstallGlobalCtors(), LinkAppendingVars(), LowerNegateToMultiply(), NegateValue(), ReplaceCallWith(), llvm::SimplifyCFG(), and TryToSimplifyUncondBranchFromEmptyBlock().
void Value::uncheckedReplaceAllUsesWith | ( | Value * | V | ) |
Definition at line 137 of file Value.cpp.
References llvm::CallingConv::C, U, and use_empty().
Referenced by llvm::ConvertConstantType< ConstantExpr, Type >::convert(), llvm::ConvertConstantType< UndefValue, Type >::convert(), llvm::ConvertConstantType< ConstantPointerNull, PointerType >::convert(), llvm::ConvertConstantType< ConstantPacked, PackedType >::convert(), llvm::ConvertConstantType< ConstantStruct, StructType >::convert(), llvm::ConvertConstantType< ConstantArray, ArrayType >::convert(), llvm::ConvertConstantType< ConstantAggregateZero, Type >::convert(), replaceAllUsesWith(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), llvm::ConstantPacked::replaceUsesOfWithOnConstant(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), and llvm::ConstantArray::replaceUsesOfWithOnConstant().
const User* llvm::Value::use_back | ( | ) | const [inline] |
User* llvm::Value::use_back | ( | ) | [inline] |
Definition at line 105 of file Value.h.
References use_begin().
Referenced by BreakUpSubtract(), ConvertShiftToMul(), DeadPHICycle(), llvm::DemoteRegToStack(), llvm::Constant::destroyConstantImpl(), OptimizeGEPExpression(), OptimizeGlobalAddressOfMalloc(), llvm::GlobalValue::removeDeadConstantUsers(), ShrinkGlobalToBoolean(), and SRAGlobal().
use_const_iterator llvm::Value::use_begin | ( | ) | const [inline] |
use_iterator llvm::Value::use_begin | ( | ) | [inline] |
Definition at line 101 of file Value.h.
Referenced by AddressIsTaken(), AllCalleesPassInValidPointerForArgument(), AllUsersAreLoads(), AllUsesOfLoadedValueWillTrapIfNull(), CallersAllIgnoreReturnValue(), llvm::ConvertExpressionToType(), ConvertOperandToType(), llvm::ExpressionConvertibleToType(), getNumUses(), llvm::SourceFunctionInfo::getSourceLocation(), hasNUses(), hasNUsesOrMore(), hasOneUse(), llvm::isAllocaPromotable(), IsOnlyUsedInEqualsZeroComparison(), LiveAtBBExit(), OptimizeAwayTrappingUsesOfLoads(), OptimizeGEPExpression(), ReplaceUsesOfWith(), SCCPSolver::Solve(), use_back(), and ~Value().
bool llvm::Value::use_empty | ( | ) | const [inline] |
Definition at line 100 of file Value.h.
Referenced by CallersAllIgnoreReturnValue(), DeadPHICycle(), llvm::DemoteRegToStack(), llvm::Constant::destroyConstantImpl(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::FunctionLoweringInfo::FunctionLoweringInfo(), getGlobalVariableClass(), InlineCallIfPossible(), InstallGlobalCtors(), llvm::isInstructionTriviallyDead(), llvm::DefaultIntrinsicLowering::LowerIntrinsicCall(), OptimizeAwayTrappingUsesOfLoads(), OptimizeGEPExpression(), OptimizeGlobalAddressOfMalloc(), ProcessGlobalsWithSameName(), RecursiveDelete(), llvm::GlobalValue::removeDeadConstantUsers(), ReplaceCallWith(), ResolveFunctions(), ShrinkGlobalToBoolean(), SRAGlobal(), uncheckedReplaceAllUsesWith(), and llvm::UpgradeIntrinsicCall().
use_const_iterator llvm::Value::use_end | ( | ) | const [inline] |
use_iterator llvm::Value::use_end | ( | ) | [inline] |
Definition at line 103 of file Value.h.
Referenced by AddressIsTaken(), AllCalleesPassInValidPointerForArgument(), AllUsersAreLoads(), AllUsesOfLoadedValueWillTrapIfNull(), CallersAllIgnoreReturnValue(), ConvertOperandToType(), llvm::ExpressionConvertibleToType(), getNumUses(), llvm::SourceFunctionInfo::getSourceLocation(), hasNUses(), hasNUsesOrMore(), hasOneUse(), llvm::isAllocaPromotable(), IsOnlyUsedInEqualsZeroComparison(), LiveAtBBExit(), OptimizeAwayTrappingUsesOfLoads(), OptimizeGEPExpression(), ReplaceUsesOfWith(), SCCPSolver::Solve(), and ~Value().
friend class Instruction [friend] |
friend class SymbolTable [friend] |
friend class ValueSymbolTable [friend] |
unsigned short llvm::Value::SubclassData [protected] |
SubclassData - This member is defined by this class, but is not used for anything. Subclasses can use it to hold whatever state they find useful. This field is initialized to zero by the ctor.
Definition at line 50 of file Value.h.
Referenced by llvm::ConstantExpr::ConstantExpr(), llvm::InvokeInst::getCallingConv(), llvm::CallInst::getCallingConv(), llvm::ConstantExpr::getOpcode(), llvm::CallInst::isTailCall(), llvm::StoreInst::isVolatile(), llvm::LoadInst::isVolatile(), llvm::InvokeInst::setCallingConv(), llvm::CallInst::setCallingConv(), llvm::CallInst::setTailCall(), llvm::StoreInst::setVolatile(), and llvm::LoadInst::setVolatile().