LLVM API Documentation

llvm::Value Class Reference

LLVM Value Representation. More...

#include <Value.h>

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

List of all members.

Public Types

enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, ConstantExprVal, ConstantAggregateZeroVal,
  ConstantIntVal, ConstantFPVal, ConstantArrayVal, ConstantStructVal,
  ConstantVectorVal, ConstantPointerNullVal, MDNodeVal, MDStringVal,
  NamedMDNodeVal, InlineAsmVal, PseudoSourceValueVal, InstructionVal,
  ConstantFirstVal = FunctionVal, ConstantLastVal = ConstantPointerNullVal
}
typedef value_use_iterator< User > use_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 Type * getType () const
LLVMContext & getContext () const
 All values hold a context through their type.
bool hasName () const
ValueName * getValueName () const
StringRef getName () const
std::string getNameStr () const
void setName (const Twine &Name)
void takeName (Value *V)
void replaceAllUsesWith (Value *V)
void uncheckedReplaceAllUsesWith (Value *V)
void clearOptionalData ()
bool use_empty () const
use_iterator use_begin ()
use_const_iterator use_begin () const
use_iterator use_end ()
use_const_iterator use_end () const
User * use_back ()
const User * use_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
bool hasSameSubclassOptionalData (const Value *V) const
void intersectOptionalDataWith (const Value *V)
const Type * getRawType () const
Value * stripPointerCasts ()
const Value * stripPointerCasts () const
Value * getUnderlyingObject ()
const Value * getUnderlyingObject () const
Value * DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
const Value * DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const

Static Public Member Functions

static bool classof (const Value *)

Protected Attributes

unsigned char SubclassOptionalData: 7
unsigned short SubclassData

Friends

class ValueSymbolTable
class SymbolTable
class ValueHandleBase


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. A Value can also have an arbitrary number of ValueHandle objects that watch it and listen to RAUW and Destroy events see llvm/Support/ValueHandle.h for details.

Definition at line 64 of file Value.h.


Member Typedef Documentation

Definition at line 160 of file Value.h.

Definition at line 161 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 
MDNodeVal 
MDStringVal 
NamedMDNodeVal 
InlineAsmVal 
PseudoSourceValueVal 
InstructionVal 
ConstantFirstVal 
ConstantLastVal 

Definition at line 205 of file Value.h.


Constructor & Destructor Documentation

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

Value::~Value (  )  [virtual]


Member Function Documentation

void Value::dump (  )  const [virtual]

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

Reimplemented in llvm::PseudoSourceValue.

Definition at line 2094 of file AsmWriter.cpp.

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

Referenced by llvm::DIGlobalVariable::dump(), and llvm::ExecutionEngine::InitializeMemory().

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

print - Implement operator<< on Value.

Definition at line 2088 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, and llvm::ShuffleVectorInst.

Definition at line 105 of file Value.h.

Referenced by llvm::AliasSetTracker::add(), llvm::PHINode::addIncoming(), AddOne(), llvm::IVUsers::AddUsersIfInteresting(), AddWithOverflow(), llvm::SelectInst::areInvalidOperands(), AssociativeOpt(), BuildSubAggregate(), llvm::Constant::canTrap(), llvm::CastInst::castIsValid(), llvm::VAArgInst::clone(), llvm::BitCastInst::clone(), llvm::IntToPtrInst::clone(), llvm::PtrToIntInst::clone(), llvm::FPToSIInst::clone(), llvm::FPToUIInst::clone(), llvm::SIToFPInst::clone(), llvm::UIToFPInst::clone(), llvm::FPExtInst::clone(), llvm::FPTruncInst::clone(), llvm::SExtInst::clone(), llvm::ZExtInst::clone(), llvm::TruncInst::clone(), llvm::CloneAndPruneFunctionInto(), CollectBSwapParts(), CollectShuffleElements(), CollectSingleShuffleElements(), compare(), 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::DIFactory::CreateBasicType(), llvm::DIFactory::CreateBlock(), llvm::TargetFolder::CreateCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateCast(), llvm::DIFactory::CreateCompileUnit(), llvm::DIFactory::CreateCompositeType(), llvm::DIFactory::CreateDerivedType(), llvm::DIFactory::CreateEnumerator(), llvm::BinaryOperator::CreateFNeg(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateFPCast(), llvm::CastInst::CreateFPCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateGlobalString(), llvm::DIFactory::CreateGlobalVariable(), llvm::TargetFolder::CreateIntCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateIntCast(), llvm::CastInst::CreateIntegerCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateIsNotNull(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateIsNull(), llvm::BinaryOperator::CreateNeg(), llvm::BinaryOperator::CreateNot(), llvm::IRBuilder< true, llvm::TargetFolder >::CreatePointerCast(), llvm::CastInst::CreatePointerCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreatePtrDiff(), llvm::FunctionLoweringInfo::CreateRegForValue(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateSExtOrBitCast(), llvm::CastInst::CreateSExtOrBitCast(), llvm::DIFactory::CreateSubprogram(), llvm::TargetFolder::CreateTruncOrBitCast(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateTruncOrBitCast(), llvm::CastInst::CreateTruncOrBitCast(), llvm::DIFactory::CreateVariable(), llvm::IRBuilder< true, llvm::TargetFolder >::CreateZExtOrBitCast(), llvm::CastInst::CreateZExtOrBitCast(), DecomposeSimpleLinearExpr(), llvm::DeleteDeadBlock(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::ConstantExpr::destroyConstant(), llvm::UndefValue::destroyConstant(), llvm::ConstantAggregateZero::destroyConstant(), dyn_castFNegVal(), dyn_castFoldableMul(), dyn_castNegVal(), dyn_castNotVal(), llvm::AsmPrinter::EmitConstantValueOnly(), EmitGEPOffset(), llvm::AsmPrinter::EmitGlobalConstant(), equals(), EvaluateExpression(), evaluateFCmpRelation(), EvaluateFunction(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), llvm::Interpreter::executeGEPOperation(), llvm::X86TargetLowering::ExpandInlineAsm(), llvm::FindAvailableLoadedValue(), llvm::findDbgGlobalDeclare(), llvm::FindInsertedValue(), FindScalarElement(), FoldBitCast(), foldConstantCastPair(), FoldOperationIntoSelectOperand(), FoldOpIntoSelect(), FoldTwoEntryPHINode(), llvm::gep_type_begin(), llvm::ConstantExpr::get(), getAccessType(), GetAddressedElementFromGlobal(), getAggregateConstantElement(), getAISize(), llvm::MemIntrinsic::getAlignmentType(), llvm::PointerTracking::getAllocationElementCount(), llvm::ConstantExpr::getBitCast(), llvm::MSILWriter::getCallSignature(), llvm::CastInst::getCastOpcode(), llvm::ConstantExpr::getCompare(), llvm::SelectionDAG::getConstantPool(), llvm::ExecutionEngine::getConstantValue(), llvm::BasicBlock::getContext(), llvm::ConstantExpr::getExtractElement(), llvm::ConstantExpr::getExtractValue(), llvm::ConstantExpr::getExtractValueTy(), llvm::ConstantExpr::getFCmp(), llvm::ConstantExpr::getFNeg(), 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::TargetLoweringObjectFile::getKindForGlobal(), llvm::SelectionDAG::getMemOperand(), getMinusOne(), llvm::AliasAnalysis::getModRefInfo(), llvm::ConstantExpr::getNeg(), llvm::MemoryDependenceAnalysis::getNonLocalPointerDependency(), llvm::ConstantExpr::getNot(), llvm::DIFactory::GetOrCreateArray(), llvm::DIFactory::GetOrCreateSubrange(), getPlusOne(), llvm::ConstantExpr::getPointerCast(), llvm::GEPOperator::getPointerOperandType(), llvm::GetElementPtrInst::getPointerOperandType(), llvm::ConstantExpr::getPtrToInt(), llvm::FastISel::getRegForGEPIndex(), llvm::FastISel::getRegForValue(), GetResultOfComparison(), llvm::ScalarEvolution::getSCEV(), llvm::ScalarEvolution::getSCEVAtScope(), llvm::ConstantExpr::getSelect(), GetSelectFoldableConstant(), llvm::ConstantExpr::getSelectTy(), llvm::ConstantExpr::getSExt(), llvm::ConstantExpr::getSExtOrBitCast(), llvm::ConstantExpr::getShuffleVector(), llvm::ScalarEvolution::getSignedRange(), llvm::ConstantExpr::getSIToFP(), llvm::SelectionDAG::getSrcValue(), GetStringLength(), llvm::ConstantExpr::getTrunc(), llvm::ConstantExpr::getTruncOrBitCast(), llvm::ConstantExpr::getTy(), llvm::SCEVUDivExpr::getType(), llvm::CallSite::getType(), llvm::ConstantExpr::getUIToFP(), getUnderlyingObject(), getUnderlyingObject(), getUnderlyingObjectFromInt(), llvm::ScalarEvolution::getUnsignedRange(), llvm::SelectionDAGLowering::getValue(), GetVectorElement(), llvm::Constant::getVectorElements(), 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::hasNoCaptureAttr(), 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::MemoryDependenceAnalysis::invalidateCachedPointerInfo(), llvm::Instruction::isAssociative(), isBytewiseValue(), IsConstantOffsetFromGlobal(), isEliminableCastPair(), isEquivalentOperation(), isFPCSafeToPrint(), isFPIntBitCast(), llvm::Instruction::isIdenticalToWhenDefined(), llvm::CastInst::isIntegerCast(), llvm::CastInst::isLosslessCast(), llvm::CastInst::isNoopCast(), IsNullTerminatedString(), isSafeToEliminateVarargsCast(), llvm::Instruction::isSameOperationAs(), llvm::ShuffleVectorInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ExtractElementInst::isValidOperands(), LowerBSWAP(), llvm::SelectionDAGLowering::LowerCallTo(), LowerCTLZ(), LowerCTPOP(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), LowerToBSwap(), MarkAliveBlocks(), MightBeFoldableInst(), OptimizeAwayTrappingUsesOfValue(), OptimizeNoopCopyExpression(), OptimizeOnceStoredGlobal(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), llvm::MSILWriter::printBasicBlock(), llvm::MSILWriter::printConstantExpr(), llvm::MSILWriter::printConstLoad(), llvm::MSILWriter::printFunctionCall(), llvm::X86ATTAsmPrinter::PrintGlobalVariable(), llvm::MSILWriter::printIndirectLoad(), llvm::MSILWriter::printIndirectSave(), llvm::MSILWriter::printStaticConstant(), llvm::MSILWriter::printStaticInitializer(), llvm::MSILWriter::printValueLoad(), PushValueAndType(), llvm::AliasSetTracker::remove(), RemoveCommonExpressionsFromUseBases(), RemoveDeadConstant(), llvm::PHINode::removeIncomingValue(), llvm::MemoryDependenceAnalysis::removeInstruction(), replaceAllUsesWith(), ReplaceFPIntrinsicWithCall(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), retrieveAddrSpace(), RewriteHeapSROALoadUser(), llvm::JIT::runFunction(), llvm::FindUsedTypes::runOnModule(), llvm::FastISel::SelectOperator(), llvm::FunctionLoweringInfo::set(), llvm::GlobalAlias::setAliasee(), llvm::MemIntrinsic::setDest(), llvm::MemIntrinsic::setLength(), setName(), llvm::MemTransferInst::setSource(), llvm::MemSetInst::setValue(), SpeculativelyExecuteBB(), llvm::SplitBlockPredecessors(), stripPointerCasts(), SubWithOverflow(), SymbolicallyEvaluateBinop(), SymbolicallyEvaluateGEP(), ThunkGToF(), TryToShrinkGlobalToBoolean(), UnderlyingObjectsAlias(), 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::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(), WriteInstruction(), WriteMDNode(), and llvm::MDNode::~MDNode().

LLVMContext & Value::getContext (  )  const

All values hold a context through their type.

Reimplemented in llvm::BasicBlock, llvm::Function, llvm::DbgStopPointInst, llvm::DbgRegionStartInst, and llvm::DbgRegionEndInst.

Definition at line 380 of file Value.cpp.

Referenced by llvm::SelectInst::areInvalidOperands(), ChangeToUnreachable(), llvm::ComputeMaskedBits(), llvm::CopyPrecedingStopPoint(), llvm::SelectionDAGLowering::CopyValueToVirtualRegister(), llvm::NamedMDNode::Create(), llvm::FunctionLoweringInfo::CreateRegForValue(), llvm::AsmPrinter::EmitConstantValueOnly(), EmitGEPOffset(), EvaluateGEPOffsetExpression(), llvm::X86TargetLowering::ExpandInlineAsm(), llvm::PointerTracking::getAllocationSizeInBytes(), llvm::GetConstantStringInfo(), llvm::ExecutionEngine::getConstantValue(), llvm::ConstantExpr::getExtractElement(), llvm::ConstantExpr::getFCmp(), llvm::ConstantExpr::getICmp(), llvm::ConstantExpr::getInsertElement(), llvm::FastISel::getRegForValue(), GetStringLengthH(), llvm::StructType::indexValid(), llvm::InlineFunction(), llvm::ConstantArray::isCString(), isEliminableCastPair(), isFPCSafeToPrint(), llvm::ConstantArray::isString(), llvm::ShuffleVectorInst::isValidOperands(), llvm::InsertElementInst::isValidOperands(), llvm::ExtractElementInst::isValidOperands(), llvm::IntrinsicLowering::LowerIntrinsicCall(), OptimizeNoopCopyExpression(), llvm::MSILWriter::printIntrinsicCall(), llvm::MSILWriter::printVAArgInstruction(), llvm::RemoveSuccessor(), ReplaceFPIntrinsicWithCall(), setName(), llvm::SimplifyCFG(), SimplifyCondBranchToTwoReturns(), llvm::SplitCriticalEdge(), llvm::UnrollLoop(), llvm::UpgradeIntrinsicCall(), llvm::Interpreter::visitReturnInst(), WriteConstantInt(), and WriteMDNode().

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

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

Definition at line 112 of file Value.h.

References Name.

Referenced by llvm::Function::getIntrinsicID().

StringRef Value::getName (  )  const

getName() - Return a constant reference to the value's name. This is cheap and guaranteed to return the same reference as long as the value is not modified.

This is currently guaranteed to return a StringRef for which data() points to a valid null terminated string. The use of StringRef.data() is deprecated here, however, and clients should not rely on it. If such behavior is needed, clients should use expensive getNameStr(), or switch to an interface that does not depend on null termination.

Definition at line 161 of file Value.cpp.

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

Referenced by llvm::ExecutionEngine::addGlobalMapping(), llvm::Interpreter::callExternalFunction(), llvm::canConstantFoldCallTo(), CanPropagatePredecessorsForPHIs(), llvm::CloneBasicBlock(), llvm::CloneFunction(), llvm::ConstantFoldCall(), llvm::NamedMDNode::Create(), llvm::DemotePHIToStack(), llvm::DemoteRegToStack(), llvm::DISubprogram::describes(), llvm::XCoreRegisterInfo::eliminateFrameIndex(), llvm::MipsRegisterInfo::eliminateFrameIndex(), llvm::ARMJITInfo::emitFunctionStub(), EmitGEPOffset(), llvm::ExecutionEngine::emitGlobals(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), EvaluateFunction(), EvaluateGEPOffsetExpression(), EvaluateStaticConstructor(), llvm::PIC16TargetLowering::ExpandFrameIndex(), ffiInvoke(), FoldBlockIntoPredecessor(), llvm::FoldBranchToCommonDest(), FoldCondBranchOnPHI(), FoldOperationIntoSelectOperand(), FoldTwoEntryPHINode(), ForceRenaming(), getBackEdges(), llvm::LibCallInfo::getFunctionInfo(), getGlobalVariableClass(), llvm::DOTGraphTraits< SelectionDAG * >::getGraphName(), llvm::DOTGraphTraits< ScheduleDAG * >::getGraphName(), llvm::MSILWriter::getLibraryName(), GetLinkageResult(), getNameStr(), llvm::DOTGraphTraits< const MachineFunction * >::getNodeLabel(), llvm::DOTGraphTraits< const Function * >::getNodeLabel(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), getSymbols(), HandleInlinedInvoke(), HoistThenElseCodeToIf(), llvm::Inliner::InlineCallIfPossible(), llvm::InlineFunction(), InstCombineLoadCast(), InstCombineStoreToCast(), LinkAlias(), LinkFunctionProtos(), LinkGlobalInits(), LinkGlobals(), LinkNamedMDNodes(), llvm::PIC16InstrInfo::loadRegFromStackSlot(), llvm::PIC16TargetLowering::LowerFormalArguments(), llvm::IntrinsicLowering::LowerIntrinsicCall(), llvm::PIC16TargetLowering::LowerReturn(), LowerToBSwap(), NegateValue(), OptimizeGlobalAddressOfMalloc(), PerformHeapAllocSRoA(), llvm::ScalarEvolution::print(), llvm::MachineInstr::print(), llvm::MachineBasicBlock::print(), print(), llvm::ARMConstantPoolValue::print(), llvm::MSILWriter::printFunctionCall(), llvm::X86IntelAsmPrinter::PrintGlobalVariable(), llvm::X86ATTAsmPrinter::PrintGlobalVariable(), llvm::MSILWriter::printInstruction(), PrintLLVMName(), llvm::DebugInfoFinder::processModule(), ReplaceCallWith(), ReplaceUsesOfMallocWithGlobal(), RewriteHeapSROALoadUser(), llvm::FPPassManager::runOnFunction(), llvm::SelectionDAGISel::runOnMachineFunction(), llvm::Inliner::runOnSCC(), llvm::PIC16TargetObjectFile::SelectSectionForGlobal(), setName(), SimplifyCondBranchToCondBranch(), SpecializeFunction(), SpeculativelyExecuteBB(), llvm::SplitBlock(), llvm::SplitBlockPredecessors(), llvm::SplitCriticalEdge(), SRAGlobal(), llvm::ELFCodeEmitter::startFunction(), llvm::PIC16InstrInfo::storeRegToStackSlot(), StripDebugInfo(), StripSymtab(), TryToShrinkGlobalToBoolean(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), and llvm::PMDataManager::verifyDomInfo().

std::string Value::getNameStr (  )  const

void Value::setName ( const Twine &  Name  ) 

void Value::takeName ( Value *  V  ) 

void Value::replaceAllUsesWith ( Value *  V  ) 

void Value::uncheckedReplaceAllUsesWith ( Value *  V  ) 

void llvm::Value::clearOptionalData (  )  [inline]

clearOptionalData - Clear any optional optimization data from this Value. Transformation passes must call this method whenever changing the IR in a way that would affect the values produced by this Value, unless it takes special care to ensure correctness in some other way.

Definition at line 155 of file Value.h.

References SubclassOptionalData.

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

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

Definition at line 164 of file Value.h.

Referenced by AddressIsTaken(), llvm::IVUsers::AddUsersIfInteresting(), AllCalleesPassInValidPointerForArgument(), AllGlobalLoadUsesSimpleEnoughForHeapSRA(), AllUsersAreLoads(), AllUsesOfLoadedValueWillTrapIfNull(), AllUsesOfValueWillTrapIfNull(), AnalyzeGlobal(), ChangeCalleesToFastCall(), llvm::GraphTraits< const Value * >::child_begin(), llvm::GraphTraits< Value * >::child_begin(), CleanupConstantGlobalUsers(), ConstantPropUsersOf(), FindAllMemoryUses(), llvm::findDbgDeclare(), llvm::findDbgGlobalDeclare(), getGlobalVariablesUsing(), getNextStopPoint(), getNumUses(), llvm::SourceFunctionInfo::getSourceLocation(), GlobalUsersSafeToSRA(), llvm::Function::hasAddressTaken(), hasNUses(), hasNUsesOrMore(), hasOneUse(), llvm::isAllocaPromotable(), isOnlyCopiedFromConstantGlobal(), isOnlyUsedInEntryBlock(), IsOnlyUsedInZeroEqualityComparison(), isSafeSROAElementUse(), isUsedInBasicBlock(), isUsedOutsideLoop(), llvm::Instruction::isUsedOutsideOfBlock(), isUsedOutsideOfDefiningBlock(), IsUserOfGlobalSafeForSRA(), LoadUsesSimpleEnoughForHeapSRA(), llvm::BitcodeReader::materializeFunction(), llvm::BitcodeReader::materializeModule(), OnlyUsedBy(), llvm::OnlyUsedByDbgInfoIntrinsics(), OptimizeAwayTrappingUsesOfLoads(), OptimizeAwayTrappingUsesOfValue(), OptimizeCmpExpression(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), PushDefUseChildren(), llvm::RecursivelyDeleteDeadPHINode(), llvm::GlobalValue::removeDeadConstantUsers(), RemoveNestAttribute(), ReplaceUsesOfMallocWithGlobal(), RewriteHeapSROALoadUser(), RewriteUsesOfLoadForHeapSRoA(), SafeToDestroyConstant(), llvm::SparseSolver::Solve(), 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 165 of file Value.h.

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

Definition at line 166 of file Value.h.

Referenced by AddressIsTaken(), llvm::IVUsers::AddUsersIfInteresting(), AllCalleesPassInValidPointerForArgument(), AllGlobalLoadUsesSimpleEnoughForHeapSRA(), AllUsersAreLoads(), AllUsesOfLoadedValueWillTrapIfNull(), AllUsesOfValueWillTrapIfNull(), AnalyzeGlobal(), ChangeCalleesToFastCall(), llvm::GraphTraits< Value * >::child_end(), llvm::GraphTraits< const Value * >::child_end(), CleanupConstantGlobalUsers(), ConstantPropUsersOf(), FindAllMemoryUses(), llvm::findDbgDeclare(), llvm::findDbgGlobalDeclare(), getGlobalVariablesUsing(), getNextStopPoint(), getNumUses(), llvm::SourceFunctionInfo::getSourceLocation(), GlobalUsersSafeToSRA(), llvm::Function::hasAddressTaken(), hasNUses(), hasNUsesOrMore(), hasOneUse(), llvm::isAllocaPromotable(), isOnlyCopiedFromConstantGlobal(), isOnlyUsedInEntryBlock(), IsOnlyUsedInZeroEqualityComparison(), isSafeSROAElementUse(), isUsedInBasicBlock(), isUsedOutsideLoop(), llvm::Instruction::isUsedOutsideOfBlock(), isUsedOutsideOfDefiningBlock(), IsUserOfGlobalSafeForSRA(), LoadUsesSimpleEnoughForHeapSRA(), llvm::BitcodeReader::materializeFunction(), llvm::BitcodeReader::materializeModule(), OnlyUsedBy(), llvm::OnlyUsedByDbgInfoIntrinsics(), OptimizeAwayTrappingUsesOfLoads(), OptimizeAwayTrappingUsesOfValue(), OptimizeCmpExpression(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), PushDefUseChildren(), llvm::GlobalValue::removeDeadConstantUsers(), RemoveNestAttribute(), RewriteHeapSROALoadUser(), RewriteUsesOfLoadForHeapSRoA(), SafeToDestroyConstant(), llvm::SparseSolver::Solve(), SpecializeFunction(), SpeculativelyExecuteBB(), TryToShrinkGlobalToBoolean(), llvm::UnrollLoop(), llvm::UpgradeCallsToIntrinsic(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), and ~Value().

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

Definition at line 167 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 169 of file Value.h.

References use_begin().

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

bool Value::hasNUses ( unsigned  N  )  const

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

Definition at line 94 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 105 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 116 of file Value.cpp.

References llvm::dyn_cast(), E, llvm::Instruction::getParent(), use_begin(), and use_end().

Referenced by SpeculativelyExecuteBB().

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.

getNumUses - This method computes the number of uses of this Value. This is a linear time operation. Use hasOneUse or hasNUses to check for specific values.

Definition at line 129 of file Value.cpp.

References use_begin(), and use_end().

void llvm::Value::addUse ( Use &  U  )  [inline]

addUse - This method should only be used by the Use class.

Definition at line 199 of file Value.h.

References llvm::Use::addToList().

Referenced by llvm::Use::set(), and llvm::Use::swap().

unsigned llvm::Value::getValueID (  )  const [inline]

getValueID - 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 for instructions, the Instruction's opcode is added to InstructionVal. So this means three things: # there is no value with code InstructionVal (no opcode==0). # there are more possible values for the value type than in ValueTy enum. # the InstructionVal enumerator must be the highest valued enumerator in the ValueTy enum.

Definition at line 241 of file Value.h.

Referenced by llvm::PseudoSourceValue::classof(), llvm::NamedMDNode::classof(), llvm::MDNode::classof(), llvm::MDString::classof(), llvm::MetadataBase::classof(), llvm::Instruction::classof(), llvm::InlineAsm::classof(), llvm::GlobalVariable::classof(), llvm::GlobalValue::classof(), llvm::GlobalAlias::classof(), llvm::Function::classof(), llvm::UndefValue::classof(), llvm::ConstantExpr::classof(), llvm::ConstantPointerNull::classof(), llvm::ConstantVector::classof(), llvm::ConstantStruct::classof(), llvm::ConstantArray::classof(), llvm::ConstantAggregateZero::classof(), llvm::ConstantFP::classof(), llvm::ConstantInt::classof(), llvm::Constant::classof(), llvm::BasicBlock::classof(), llvm::Argument::classof(), equals(), and llvm::Instruction::getOpcode().

bool llvm::Value::hasSameSubclassOptionalData ( const Value *  V  )  const [inline]

hasSameSubclassOptionalData - Test whether the optional flags contained in this value are equal to the optional flags in the given value.

Definition at line 247 of file Value.h.

References SubclassOptionalData.

Referenced by isEquivalentOperation().

void llvm::Value::intersectOptionalDataWith ( const Value *  V  )  [inline]

intersectOptionalDataWith - Clear any optional flags in this value that are not also set in the given value.

Definition at line 253 of file Value.h.

References SubclassOptionalData.

Referenced by HoistThenElseCodeToIf().

static bool llvm::Value::classof ( const Value *   )  [inline, static]

Reimplemented in llvm::Argument, llvm::BasicBlock, llvm::PseudoSourceValue, llvm::Constant, llvm::ConstantInt, llvm::ConstantFP, llvm::ConstantAggregateZero, llvm::ConstantArray, llvm::ConstantStruct, llvm::ConstantVector, llvm::ConstantPointerNull, llvm::ConstantExpr, llvm::UndefValue, llvm::Function, llvm::GlobalAlias, llvm::GlobalValue, llvm::GlobalVariable, llvm::InlineAsm, llvm::TerminatorInst, llvm::UnaryInstruction, llvm::BinaryOperator, llvm::CastInst, llvm::CmpInst, llvm::Instruction, llvm::AllocationInst, llvm::MallocInst, llvm::AllocaInst, llvm::FreeInst, llvm::LoadInst, llvm::StoreInst, llvm::GetElementPtrInst, llvm::ICmpInst, llvm::FCmpInst, llvm::CallInst, llvm::SelectInst, llvm::VAArgInst, llvm::ExtractElementInst, llvm::InsertElementInst, llvm::ShuffleVectorInst, llvm::ExtractValueInst, llvm::InsertValueInst, llvm::PHINode, llvm::ReturnInst, llvm::BranchInst, llvm::SwitchInst, llvm::InvokeInst, llvm::UnwindInst, llvm::UnreachableInst, llvm::TruncInst, llvm::ZExtInst, llvm::SExtInst, llvm::FPTruncInst, llvm::FPExtInst, llvm::UIToFPInst, llvm::SIToFPInst, llvm::FPToUIInst, llvm::FPToSIInst, llvm::IntToPtrInst, llvm::PtrToIntInst, llvm::BitCastInst, llvm::IntrinsicInst, llvm::DbgInfoIntrinsic, llvm::DbgStopPointInst, llvm::DbgFuncStartInst, llvm::DbgRegionStartInst, llvm::DbgRegionEndInst, llvm::DbgDeclareInst, llvm::MemIntrinsic, llvm::MemSetInst, llvm::MemTransferInst, llvm::MemCpyInst, llvm::MemMoveInst, llvm::EHSelectorInst, llvm::MetadataBase, llvm::MDString, llvm::MDNode, llvm::NamedMDNode, llvm::Operator, llvm::OverflowingBinaryOperator, llvm::AddOperator, llvm::SubOperator, llvm::MulOperator, llvm::SDivOperator, llvm::GEPOperator, and llvm::User.

Definition at line 258 of file Value.h.

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

getRawType - This should only be used to implement the vmcore library.

Definition at line 264 of file Value.h.

References llvm::PATypeHolder::getRawType().

Value * Value::stripPointerCasts (  ) 

stripPointerCasts - This method strips off any unneeded pointer casts from the specified value, returning the original uncasted value. Note that the returned value has pointer type if the specified value does.

Definition at line 332 of file Value.cpp.

References BitCast, llvm::Operator::getOpcode(), getType(), and V.

Referenced by llvm::MachineModuleInfo::AnalyzeModule(), ExtractTypeInfo(), llvm::findDbgDeclare(), llvm::findDbgGlobalDeclare(), findUsedValues(), llvm::DIDescriptor::getDescriptorField(), llvm::MemIntrinsic::getDest(), llvm::DIDescriptor::getGlobalVariableField(), llvm::PointerTracking::getPointerOffset(), llvm::MemTransferInst::getSource(), OptimizeOnceStoredGlobal(), stripPointerCasts(), and llvm::DIDescriptor::ValidDebugInfo().

const Value* llvm::Value::stripPointerCasts (  )  const [inline]

Definition at line 270 of file Value.h.

References stripPointerCasts().

Value * Value::getUnderlyingObject (  ) 

getUnderlyingObject - This method strips off any GEP address adjustments and pointer casts from the specified value, returning the original object being addressed. Note that the returned value has pointer type if the specified value does.

Definition at line 350 of file Value.cpp.

References BitCast, llvm::Operator::getOpcode(), getType(), and V.

Referenced by llvm::PointerTracking::getPointerOffset(), getUnderlyingObject(), getUnderlyingObject(), and UnderlyingObjectsAlias().

const Value* llvm::Value::getUnderlyingObject (  )  const [inline]

Definition at line 279 of file Value.h.

References getUnderlyingObject().

Value * Value::DoPHITranslation ( const BasicBlock *  CurBB,
const BasicBlock *  PredBB 
)

DoPHITranslation - If this value is a PHI node with CurBB as its parent, return the value in the PHI node corresponding to PredBB. If not, return ourself. This is useful if you want to know the value something has in a predecessor block.

DoPHITranslation - If this value is a PHI node with CurBB as its parent, return the value in the PHI node corresponding to PredBB. If not, return ourself. This is useful if you want to know the value something has in a predecessor block.

Definition at line 372 of file Value.cpp.

References llvm::dyn_cast(), llvm::PHINode::getIncomingValueForBlock(), and llvm::Instruction::getParent().

Referenced by DoPHITranslation().

const Value* llvm::Value::DoPHITranslation ( const BasicBlock *  CurBB,
const BasicBlock *  PredBB 
) const [inline]

Definition at line 289 of file Value.h.

References DoPHITranslation().


Friends And Related Function Documentation

friend class ValueSymbolTable [friend]

Definition at line 82 of file Value.h.

friend class SymbolTable [friend]

Definition at line 83 of file Value.h.

friend class ValueHandleBase [friend]

Definition at line 84 of file Value.h.


Member Data Documentation

SubclassOptionalData - This member is similar to SubclassData, however it is for holding information which may be used to aid optimization, but which may be cleared to zero without affecting conservative interpretation.

Definition at line 72 of file Value.h.

Referenced by clearOptionalData(), llvm::ZExtInst::clone(), llvm::CallInst::clone(), llvm::ShuffleVectorInst::clone(), llvm::InsertValueInst::clone(), llvm::FreeInst::clone(), llvm::UnreachableInst::clone(), llvm::ICmpInst::clone(), llvm::FPTruncInst::clone(), llvm::VAArgInst::clone(), llvm::GetElementPtrInst::clone(), llvm::FPToUIInst::clone(), llvm::PtrToIntInst::clone(), llvm::AllocaInst::clone(), llvm::LoadInst::clone(), llvm::BranchInst::clone(), llvm::SwitchInst::clone(), llvm::ExtractValueInst::clone(), llvm::TruncInst::clone(), llvm::FPToSIInst::clone(), llvm::SelectInst::clone(), llvm::StoreInst::clone(), llvm::FPExtInst::clone(), llvm::InsertElementInst::clone(), llvm::SExtInst::clone(), llvm::SIToFPInst::clone(), llvm::InvokeInst::clone(), llvm::PHINode::clone(), llvm::ReturnInst::clone(), llvm::BinaryOperator::clone(), llvm::MallocInst::clone(), llvm::IntToPtrInst::clone(), llvm::ExtractElementInst::clone(), llvm::BitCastInst::clone(), llvm::FCmpInst::clone(), llvm::UIToFPInst::clone(), llvm::UnwindInst::clone(), llvm::OverflowingBinaryOperator::hasNoSignedWrap(), llvm::OverflowingBinaryOperator::hasNoUnsignedWrap(), hasSameSubclassOptionalData(), intersectOptionalDataWith(), llvm::SDivOperator::isExact(), llvm::Instruction::isIdenticalTo(), llvm::GEPOperator::isInBounds(), llvm::OverflowingBinaryOperator::setHasNoSignedWrap(), llvm::OverflowingBinaryOperator::setHasNoUnsignedWrap(), llvm::SDivOperator::setIsExact(), and llvm::GEPOperator::setIsInBounds().

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

Referenced by llvm::ConstantExpr::ConstantExpr(), llvm::AllocationInst::getAlignment(), llvm::LoadInst::getAlignment(), llvm::StoreInst::getAlignment(), llvm::Function::getCallingConv(), llvm::ConstantExpr::getOpcode(), llvm::LoadInst::isVolatile(), llvm::StoreInst::isVolatile(), llvm::Function::setCallingConv(), llvm::StoreInst::setVolatile(), and llvm::LoadInst::setVolatile().


The documentation for this class was generated from the following files: