LLVM API Documentation

llvm::Value Class Reference

LLVM Value Representation. More...

#include <Value.h>

Inheritance diagram for llvm::Value:

Inheritance graph
[legend]
Collaboration diagram for llvm::Value:

Collaboration graph
[legend]

List of all members.

Public Types

enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, ConstantExprVal, ConstantAggregateZeroVal,
  ConstantIntVal, ConstantFPVal, ConstantArrayVal, ConstantStructVal,
  ConstantVectorVal, ConstantPointerNullVal, InlineAsmVal, PseudoSourceValueVal,
  InstructionVal, ConstantFirstVal = FunctionVal, ConstantLastVal = ConstantPointerNullVal
}
typedef value_use_iterator< Useruse_iterator
typedef value_use_iterator
< const User
use_const_iterator

Public Member Functions

 Value (const Type *Ty, unsigned scid)
virtual ~Value ()
virtual void dump () const
 dump - Support for debugging, callable in GDB: V->dump()
void print (std::ostream &O, AssemblyAnnotationWriter *AAW=0) const
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
const TypegetType () const
bool hasName () const
ValueNamegetValueName () const
const char * getNameStart () const
const char * getNameEnd () const
 getNameEnd - Return a pointer to the end of the name.
bool isName (const char *N) const
unsigned getNameLen () const
std::string getName () const
std::string getNameStr () const
void setName (const std::string &name)
void setName (const char *Name, unsigned NameLen)
void setName (const char *Name)
void takeName (Value *V)
void replaceAllUsesWith (Value *V)
void uncheckedReplaceAllUsesWith (Value *V)
bool use_empty () const
use_iterator use_begin ()
use_const_iterator use_begin () const
use_iterator use_end ()
use_const_iterator use_end () const
Useruse_back ()
const Useruse_back () const
bool hasOneUse () const
bool hasNUses (unsigned N) const
bool hasNUsesOrMore (unsigned N) const
bool isUsedInBasicBlock (const BasicBlock *BB) const
unsigned getNumUses () const
void addUse (Use &U)
unsigned getValueID () const
const TypegetRawType () const
ValuestripPointerCasts ()
const ValuestripPointerCasts () const
ValuegetUnderlyingObject ()
const ValuegetUnderlyingObject () const

Static Public Member Functions

static bool classof (const Value *)

Protected Attributes

unsigned short SubclassData

Friends

class ValueSymbolTable
class SymbolTable


Detailed Description

LLVM Value Representation.

This is a very important LLVM class. It is the base class of all values computed by a program that may be used as operands to other values. Value is the super class of other important classes such as Instruction and Function. All Values have a Type. Type is not a subclass of Value. All types can have a name and they should belong to some Module. Setting the name on the Value automatically updates the module's symbol table.

Every value has a "use list" that keeps track of which other Values are using this Value.

Definition at line 55 of file Value.h.


Member Typedef Documentation

Definition at line 138 of file Value.h.

Definition at line 139 of file Value.h.


Member Enumeration Documentation

An enumeration for keeping track of the concrete subclass of Value that is actually instantiated. Values of this enumeration are kept in the Value classes SubclassID field. They are used for concrete type identification.

Enumerator:
ArgumentVal 
BasicBlockVal 
FunctionVal 
GlobalAliasVal 
GlobalVariableVal 
UndefValueVal 
ConstantExprVal 
ConstantAggregateZeroVal 
ConstantIntVal 
ConstantFPVal 
ConstantArrayVal 
ConstantStructVal 
ConstantVectorVal 
ConstantPointerNullVal 
InlineAsmVal 
PseudoSourceValueVal 
InstructionVal 
ConstantFirstVal 
ConstantLastVal 

Definition at line 183 of file Value.h.


Constructor & Destructor Documentation

Value::Value ( const Type Ty,
unsigned  scid 
)

Definition at line 35 of file Value.cpp.

References llvm::Type::StructTyID, and llvm::Type::VoidTy.

Value::~Value (  )  [virtual]


Member Function Documentation

void Value::dump (  )  const [virtual]

dump - Support for debugging, callable in GDB: V->dump()

Definition at line 1832 of file AsmWriter.cpp.

References llvm::errs(), llvm::raw_ostream::flush(), and print().

Referenced by llvm::ExecutionEngine::InitializeMemory().

void Value::print ( std::ostream &  O,
AssemblyAnnotationWriter AAW = 0 
) const

print - Implement operator<< on Value.

Definition at line 1826 of file AsmWriter.cpp.

References OS.

Referenced by dump(), llvm::operator<<(), and llvm::MachineConstantPool::print().

void Value::print ( raw_ostream O,
AssemblyAnnotationWriter AAW = 0 
) const

const Type* llvm::Value::getType (  )  const [inline]

All values are typed, get the type of this value.

Reimplemented in llvm::ConstantInt, llvm::ConstantArray, llvm::ConstantStruct, llvm::ConstantVector, llvm::ConstantPointerNull, llvm::GlobalValue, llvm::InlineAsm, llvm::AllocationInst, llvm::GetElementPtrInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, llvm::ExtractValueInst, and llvm::InsertValueInst.

Definition at line 88 of file Value.h.

Referenced by llvm::AliasSetTracker::add(), llvm::PHINode::addIncoming(), AssociativeOpt(), BuildSubAggregate(), llvm::Constant::canTrap(), llvm::CastInst::castIsValid(), llvm::CloneAndPruneFunctionInto(), CollectBSwapParts(), CollectShuffleElements(), CollectSingleShuffleElements(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::ConstantArray::ConstantArray(), llvm::ConstantFoldBinaryInstruction(), llvm::ConstantFoldCastInstruction(), llvm::ConstantFoldCompareInstOperands(), llvm::ConstantFoldCompareInstruction(), llvm::ConstantFoldConstantExpression(), llvm::ConstantFoldExtractElementInstruction(), llvm::ConstantFoldExtractValueInstruction(), llvm::ConstantFoldGetElementPtr(), llvm::ConstantFoldInsertElementInstruction(), llvm::ConstantFoldInsertValueInstruction(), llvm::ConstantFoldInstOperands(), llvm::ConstantFoldInstruction(), llvm::ConstantFoldLoadThroughGEPConstantExpr(), llvm::ConstantFoldShuffleVectorInstruction(), llvm::ConstantStruct::ConstantStruct(), llvm::ConstantVector::ConstantVector(), ConvertShiftToMul(), llvm::SelectionDAGLowering::CopyValueToVirtualRegister(), llvm::BinaryOperator::Create(), llvm::DebugInfoBuilder::createBasicTypeDescriptor(), llvm::TargetFolder::CreateCast(), llvm::IRBuilder< preserveNames, T >::CreateCast(), llvm::DebugInfoBuilder::createCharacterTypeDescriptor(), llvm::DebugInfoBuilder::createCompileUnitDescriptor(), llvm::DebugInfoBuilder::createFloatTypeDescriptor(), llvm::CastInst::CreateFPCast(), llvm::IRBuilder< preserveNames, T >::CreateGlobalString(), llvm::TargetFolder::CreateIntCast(), llvm::IRBuilder< preserveNames, T >::CreateIntCast(), llvm::CastInst::CreateIntegerCast(), llvm::DebugInfoBuilder::createIntegerTypeDescriptor(), llvm::IRBuilder< preserveNames, T >::CreateIsNotNull(), llvm::IRBuilder< preserveNames, T >::CreateIsNull(), llvm::BinaryOperator::CreateNeg(), llvm::BinaryOperator::CreateNot(), llvm::CastInst::CreatePointerCast(), llvm::DebugInfoBuilder::createPointerTypeDescriptor(), llvm::FunctionLoweringInfo::CreateRegForValue(), llvm::CastInst::CreateSExtOrBitCast(), llvm::DebugInfoBuilder::createSubProgramDescriptor(), llvm::TargetFolder::CreateTruncOrBitCast(), llvm::CastInst::CreateTruncOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), DecomposeSimpleLinearExpr(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), DominatesMergePoint(), dyn_castFoldableMul(), dyn_castNegVal(), llvm::AsmPrinter::EmitConstantValueOnly(), EmitGEPOffset(), llvm::AsmPrinter::EmitGlobalConstant(), EvaluateExpression(), evaluateFCmpRelation(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), llvm::Interpreter::executeGEPOperation(), llvm::X86TargetAsmInfo< BaseTAI >::ExpandInlineAsm(), llvm::FindInsertedValue(), FindMaximalLegalAddressingMode(), FindScalarElement(), FoldBitCast(), FoldCondBranchOnPHI(), foldConstantCastPair(), FoldOperationIntoSelectOperand(), FoldOpIntoSelect(), FoldTwoEntryPHINode(), llvm::gep_type_begin(), llvm::ConstantExpr::get(), GetAddressedElementFromGlobal(), getAggregateConstantElement(), getAISize(), llvm::ConstantExpr::getBitCast(), llvm::CastInst::getCastOpcode(), llvm::ConstantExpr::getCompare(), llvm::ConstantExpr::getCompareTy(), llvm::SelectionDAG::getConstantPool(), GetConstantPoolSizeInBytes(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantExpr::getExtractElement(), llvm::ConstantExpr::getExtractValue(), llvm::ConstantExpr::getExtractValueTy(), llvm::ConstantExpr::getFCmp(), llvm::ConstantExpr::getFPCast(), llvm::ConstantExpr::getFPExtend(), llvm::ConstantExpr::getFPToSI(), llvm::ConstantExpr::getFPToUI(), llvm::ConstantExpr::getFPTrunc(), llvm::ConstantExpr::getGetElementPtr(), llvm::ConstantExpr::getGetElementPtrTy(), llvm::ConstantExpr::getICmp(), llvm::ConstantExpr::getInsertElement(), llvm::ConstantExpr::getInsertValue(), llvm::ConstantExpr::getInsertValueTy(), llvm::ConstantExpr::getIntegerCast(), llvm::ConstantExpr::getIntToPtr(), llvm::SelectionDAG::getMemOperand(), llvm::AliasAnalysis::getModRefInfo(), llvm::ConstantExpr::getNeg(), llvm::ConstantExpr::getNot(), llvm::ConstantExpr::getPointerCast(), llvm::ConstantExpr::getPtrToInt(), llvm::FastISel::getRegForValue(), llvm::ConstantExpr::getSelect(), GetSelectFoldableConstant(), llvm::ConstantExpr::getSelectTy(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSExtOrBitCast(), llvm::ConstantExpr::getShuffleVector(), llvm::ConstantExpr::getSIToFP(), llvm::SelectionDAG::getSrcValue(), llvm::DISerializer::getString(), GetStringLength(), llvm::ConstantExpr::getTrunc(), llvm::ConstantExpr::getTruncOrBitCast(), llvm::ConstantExpr::getTy(), llvm::SCEVUDivExpr::getType(), llvm::CallSite::getType(), llvm::ConstantExpr::getUIToFP(), getUnderlyingObject(), llvm::SelectionDAGLowering::getValue(), llvm::Mangler::getValueName(), GetVectorElement(), llvm::Constant::getVectorElements(), llvm::ConstantExpr::getVFCmp(), llvm::ConstantExpr::getVICmp(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::ConstantExpr::getZExt(), llvm::ConstantExpr::getZExtOrBitCast(), llvm::GlobalAlias::GlobalAlias(), llvm::GlobalVariable::GlobalVariable(), llvm::Argument::hasByValAttr(), llvm::PHINode::hasConstantValue(), llvm::Argument::hasNoAliasAttr(), llvm::Argument::hasStructRetAttr(), HoistThenElseCodeToIf(), IdxCompare(), IndexOperandsEqual(), llvm::SequentialType::indexValid(), llvm::StructType::indexValid(), llvm::BinaryOperator::init(), llvm::ExecutionEngine::InitializeMemory(), llvm::MachOWriter::InitMem(), llvm::InlineFunction(), InsertCastToIntPtrTy(), llvm::InsertProfilingInitCall(), InstallGlobalCtors(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::Instruction::isAssociative(), isBytewiseValue(), IsConstantOffsetFromGlobal(), isEliminableCastPair(), isFPCSafeToPrint(), isFPIntBitCast(), llvm::Instruction::isIdenticalTo(), llvm::CastInst::isIntegerCast(), llvm::CastInst::isLosslessCast(), llvm::CastInst::isNoopCast(), isSafeToEliminateVarargsCast(), llvm::Instruction::isSameOperationAs(), llvm::ShuffleVectorInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ExtractElementInst::isValidOperands(), llvm::TargetLowering::LowerArguments(), LowerBSWAP(), llvm::SelectionDAGLowering::LowerCallTo(), LowerCTLZ(), LowerCTPOP(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), LowerPartSelect(), LowerPartSet(), llvm::ELFTargetAsmInfo::MergeableConstSection(), llvm::DarwinTargetAsmInfo::MergeableConstSection(), MoveImmediateValues(), OptimizeNoopCopyExpression(), OptimizeOnceStoredGlobal(), PerformHeapAllocSRoA(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), PushValueAndType(), llvm::AliasSetTracker::remove(), RemoveCommonExpressionsFromUseBases(), RemoveDeadConstant(), llvm::PHINode::removeIncomingValue(), replaceAllUsesWith(), ReplaceFPIntrinsicWithCall(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), retrieveAddrSpace(), RewriteHeapSROALoadUser(), llvm::JIT::runFunction(), llvm::FindUsedTypes::runOnModule(), llvm::FastISel::SelectOperator(), llvm::FunctionLoweringInfo::set(), llvm::GlobalAlias::setAliasee(), llvm::MemIntrinsic::setAlignment(), llvm::MemIntrinsic::setDest(), llvm::MemIntrinsic::setLength(), setName(), llvm::MemMoveInst::setSource(), llvm::MemCpyInst::setSource(), llvm::MemSetInst::setValue(), llvm::SimplifyCFG(), SpeculativelyExecuteBB(), llvm::SplitBlockPredecessors(), stripPointerCasts(), SymbolicallyEvaluateBinop(), SymbolicallyEvaluateGEP(), TryToShrinkGlobalToBoolean(), llvm::UpgradeIntrinsicCall(), ValueRequiresCast(), llvm::Interpreter::visitBinaryOperator(), llvm::Interpreter::visitBitCastInst(), llvm::Interpreter::visitCallSite(), llvm::Interpreter::visitFCmpInst(), llvm::Interpreter::visitFPExtInst(), llvm::Interpreter::visitFPToSIInst(), llvm::Interpreter::visitFPToUIInst(), llvm::Interpreter::visitFPTruncInst(), llvm::Interpreter::visitFreeInst(), llvm::Interpreter::visitICmpInst(), llvm::Interpreter::visitIntToPtrInst(), llvm::Interpreter::visitLoadInst(), llvm::SCEVExpander::visitMulExpr(), llvm::Interpreter::visitPtrToIntInst(), llvm::Interpreter::visitReturnInst(), llvm::Interpreter::visitSExtInst(), llvm::Interpreter::visitSIToFPInst(), llvm::Interpreter::visitStoreInst(), llvm::Interpreter::visitSwitchInst(), llvm::Interpreter::visitTruncInst(), llvm::Interpreter::visitUIToFPInst(), llvm::Interpreter::visitVAArgInst(), llvm::Interpreter::visitZExtInst(), llvm::WriteAsOperand(), WriteConstantInt(), WriteConstants(), and WriteInstruction().

bool llvm::Value::hasName (  )  const [inline]

ValueName* llvm::Value::getValueName (  )  const [inline]

Definition at line 92 of file Value.h.

References Name.

Referenced by llvm::canConstantFoldCallTo(), llvm::ConstantFoldCall(), and llvm::Function::getIntrinsicID().

const char * Value::getNameStart (  )  const

getNameStart - Return a pointer to a null terminated string for this name. Note that names can have null characters within the string as well as at their end. This always returns a non-null pointer.

getNameStart - Return a pointer to a null terminated string for this name. Note that names can have null characters within the string as well as at their end. This always returns a non-null pointer.

Definition at line 140 of file Value.cpp.

References llvm::StringMapEntry< ValueTy >::getKeyData().

Referenced by CanPropagatePredecessorsForPHIs(), EvaluateGEPOffsetExpression(), llvm::LibCallInfo::getFunctionInfo(), getNameEnd(), llvm::Mangler::getValueName(), InsertName(), isName(), LinkFunctionProtos(), LinkGlobals(), llvm::AsmPrinter::printBasicBlockLabel(), PrintLLVMName(), PrintUnmangledNameSafely(), llvm::FPPassManager::runOnFunction(), llvm::UpgradeIntrinsicCall(), and llvm::PMDataManager::verifyDomInfo().

const char* llvm::Value::getNameEnd (  )  const [inline]

getNameEnd - Return a pointer to the end of the name.

Definition at line 99 of file Value.h.

References getNameLen(), and getNameStart().

Referenced by LinkFunctionProtos(), and LinkGlobals().

bool Value::isName ( const char *  N  )  const

isName - Return true if this value has the name specified by the provided nul terminated string.

isName - Return true if this value has the name specified by the provided nul terminated string.

Definition at line 153 of file Value.cpp.

References getNameLen(), and getNameStart().

unsigned Value::getNameLen (  )  const

getNameLen - Return the length of the string, correctly handling nul characters embedded into them.

getNameLen - Return the length of the string, correctly handling nul characters embedded into them.

Definition at line 147 of file Value.cpp.

References llvm::StringMapEntryBase::getKeyLength().

Referenced by llvm::LibCallInfo::getFunctionInfo(), getNameEnd(), isName(), PrintLLVMName(), and PrintUnmangledNameSafely().

std::string llvm::Value::getName (  )  const [inline]

getName()/getNameStr() - Return the name of the specified value, constructing a string* to hold it. Because these are guaranteed to construct a string, they are very expensive and should be avoided.

Definition at line 112 of file Value.h.

References getNameStr().

Referenced by llvm::Interpreter::callExternalFunction(), llvm::CloneBasicBlock(), llvm::CloneFunction(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::PIC16RegisterInfo::eliminateFrameIndex(), llvm::MipsRegisterInfo::eliminateFrameIndex(), EmitGEPOffset(), llvm::ExecutionEngine::emitGlobals(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), EvaluateFunction(), EvaluateStaticConstructor(), FoldBlockIntoPredecessor(), FoldBranchToCommonDest(), FoldCondBranchOnPHI(), FoldOperationIntoSelectOperand(), FoldTwoEntryPHINode(), ForceRenaming(), getBackEdges(), llvm::AsmPrinter::getCurrentFunctionEHName(), getGlobalVariableClass(), llvm::DOTGraphTraits< SelectionDAG * >::getGraphName(), llvm::DOTGraphTraits< const MachineFunction * >::getGraphName(), llvm::DOTGraphTraits< const Function * >::getGraphName(), GetHeapSROALoad(), GetLinkageResult(), llvm::DOTGraphTraits< const MachineFunction * >::getNodeLabel(), llvm::DOTGraphTraits< const Function * >::getNodeLabel(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), getSymbols(), llvm::Mangler::getValueName(), HandleInlinedInvoke(), HoistThenElseCodeToIf(), InlineCallIfPossible(), llvm::InlineFunction(), llvm::SCEVExpander::InsertCastOfTo(), InstCombineLoadCast(), InstCombineStoreToCast(), LinkAlias(), LinkFunctionProtos(), LinkGlobalInits(), LinkGlobals(), llvm::PIC16InstrInfo::loadRegFromStackSlot(), lookupFunction(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerPartSelect(), LowerPartSet(), NegateValue(), OptimizeGlobalAddressOfMalloc(), PerformHeapAllocSRoA(), llvm::Trace::print(), llvm::ScalarEvolution::print(), llvm::PIC16ConstantPoolValue::print(), llvm::MachineInstr::print(), llvm::MachineFunction::print(), llvm::MachineBasicBlock::print(), llvm::CallGraphNode::print(), llvm::ARMConstantPoolValue::print(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), ReplaceCallWith(), ReplaceUsesOfMallocWithGlobal(), RewriteHeapSROALoadUser(), llvm::SelectionDAGISel::runOnFunction(), llvm::X86ATTAsmPrinter::runOnMachineFunction(), llvm::Inliner::runOnSCC(), SimplifyCondBranchToCondBranch(), SpecializeFunction(), SpeculativelyExecuteBB(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), SRAGlobal(), llvm::PIC16InstrInfo::storeRegToStackSlot(), TryToShrinkGlobalToBoolean(), llvm::X86COFFTargetAsmInfo::UniqueSectionForGlobal(), llvm::TargetAsmInfo::UniqueSectionForGlobal(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), llvm::Function::viewCFG(), and llvm::ScheduleDAG::viewGraph().

std::string Value::getNameStr (  )  const

void Value::setName ( const std::string &  name  ) 

void Value::setName ( const char *  Name,
unsigned  NameLen 
)

void Value::setName ( const char *  Name  ) 

Definition at line 169 of file Value.cpp.

References setName().

void Value::takeName ( Value V  ) 

takeName - transfer the name from V to this value, setting V's name to empty. It is an error to call V->takeName(V).

takeName - transfer the name from V to this value, setting V's name to empty. It is an error to call V->takeName(V).

Definition at line 231 of file Value.cpp.

References llvm::StringMapEntry< ValueTy >::Destroy(), getSymTab(), hasName(), Name, llvm::ValueSymbolTable::reinsertValue(), llvm::ValueSymbolTable::removeValueName(), setName(), and llvm::StringMapEntry< ValueTy >::setValue().

Referenced by BreakUpSubtract(), ConvertShiftToMul(), FoldBranchToCommonDest(), FoldTwoEntryPHINode(), ForceRenaming(), HoistThenElseCodeToIf(), InstallGlobalCtors(), LowerNegateToMultiply(), llvm::MergeBlockIntoPredecessor(), TryToShrinkGlobalToBoolean(), and TryToSimplifyUncondBranchFromEmptyBlock().

void Value::replaceAllUsesWith ( Value V  ) 

void Value::uncheckedReplaceAllUsesWith ( Value V  ) 

bool llvm::Value::use_empty (  )  const [inline]

use_iterator llvm::Value::use_begin (  )  [inline]

Definition at line 142 of file Value.h.

Referenced by AddressIsTaken(), AddressMightEscape(), AllCalleesPassInValidPointerForArgument(), AllUsersAreLoads(), AllUsesOfLoadedValueWillTrapIfNull(), AllUsesOfValueWillTrapIfNull(), AnalyzeGlobal(), ChangeCalleesToFastCall(), llvm::GraphTraits< User * >::child_begin(), llvm::GraphTraits< const User * >::child_begin(), CleanupConstantGlobalUsers(), ConstantIsDead(), ConstantPropUsersOf(), getGlobalVariablesUsing(), getNextStopPoint(), getNumUses(), llvm::SourceFunctionInfo::getSourceLocation(), GlobalLoadUsesSimpleEnoughForHeapSRA(), GlobalUsersSafeToSRA(), hasNUses(), hasNUsesOrMore(), hasOneUse(), llvm::SCEVExpander::InsertCastOfTo(), llvm::isAllocaPromotable(), isOnlyCopiedFromConstantGlobal(), isOnlyUsedInEntryBlock(), IsOnlyUsedInZeroEqualityComparison(), isSafeSROAElementUse(), isUsedInBasicBlock(), llvm::Instruction::isUsedOutsideOfBlock(), isUsedOutsideOfDefiningBlock(), IsUserOfGlobalSafeForSRA(), llvm::BitcodeReader::materializeFunction(), llvm::BitcodeReader::materializeModule(), OnlyCalledDirectly(), OptimizeAwayTrappingUsesOfLoads(), OptimizeAwayTrappingUsesOfValue(), OptimizeCmpExpression(), OptimizeNoopCopyExpression(), llvm::GlobalValue::removeDeadConstantUsers(), RemoveNestAttribute(), ReplaceUsesOfMallocWithGlobal(), SpecializeFunction(), SpeculativelyExecuteBB(), TryToShrinkGlobalToBoolean(), llvm::UnrollLoop(), llvm::UpgradeCallsToIntrinsic(), use_back(), llvm::Instruction::use_back(), llvm::BasicBlock::use_back(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), and ~Value().

use_const_iterator llvm::Value::use_begin (  )  const [inline]

Definition at line 143 of file Value.h.

use_iterator llvm::Value::use_end (  )  [inline]

use_const_iterator llvm::Value::use_end (  )  const [inline]

Definition at line 145 of file Value.h.

User* llvm::Value::use_back (  )  [inline]

const User* llvm::Value::use_back (  )  const [inline]

Reimplemented in llvm::BasicBlock, and llvm::Instruction.

Definition at line 147 of file Value.h.

References use_begin().

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 153 of file Value.h.

References E, I, use_begin(), and use_end().

Referenced by AssociativeOpt(), CheapToScalarize(), ConvertShiftToMul(), DeadPHICycle(), dyn_castFoldableMul(), llvm::SelectionDAGLowering::FindMergedConditions(), FindSingleUseMultiplyFactors(), FoldBranchToCommonDest(), FoldCondBranchOnPHI(), FoldOpIntoSelect(), llvm::InlineCostAnalyzer::getInlineCost(), isOnlyUse(), isReassociableOp(), NegateValue(), RemoveDeadConstant(), ShouldBreakUpSubtract(), and TryToSinkInstruction().

bool Value::hasNUses ( unsigned  N  )  const

hasNUses - Return true if this Value has exactly N users.

Definition at line 76 of file Value.cpp.

References E, use_begin(), and use_end().

bool Value::hasNUsesOrMore ( unsigned  N  )  const

hasNUsesOrMore - Return true if this value has N users or more. This is logically equivalent to getNumUses() >= N.

hasNUsesOrMore - Return true if this value has N users or more. This is logically equivalent to getNumUses() >= N.

Definition at line 87 of file Value.cpp.

References E, use_begin(), and use_end().

Referenced by llvm::BasicBlock::removePredecessor(), and SRAGlobal().

bool Value::isUsedInBasicBlock ( const BasicBlock BB  )  const

isUsedInBasicBlock - Return true if this value is used in the specified basic block.

Definition at line 98 of file Value.cpp.

References llvm::dyn_cast(), E, llvm::Instruction::getParent(), I, use_begin(), and use_