LLVM API Documentation

llvm::User Class Reference

#include <User.h>

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

List of all members.

Public Types

typedef Use * op_iterator
typedef const Use * const_op_iterator

Public Member Functions

 ~User ()
void operator delete (void *Usr)
 operator delete - free memory allocated for User and Use objects
void operator delete (void *, unsigned)
 placement delete - required by std, but never called.
void operator delete (void *, unsigned, bool)
 placement delete - required by std, but never called.
Value * getOperand (unsigned i) const
void setOperand (unsigned i, Value *Val)
const Use & getOperandUse (unsigned i) const
Use & getOperandUse (unsigned i)
unsigned getNumOperands () const
op_iterator op_begin ()
const_op_iterator op_begin () const
op_iterator op_end ()
const_op_iterator op_end () const
void dropAllReferences ()
void replaceUsesOfWith (Value *From, Value *To)

Static Public Member Functions

static bool classof (const User *)
static bool classof (const Value *V)

Protected Member Functions

void * operator new (size_t s, unsigned Us)
void * operator new (size_t s, unsigned Us, bool Prefix)
 User (const Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
Use * allocHungoffUses (unsigned) const
void dropHungoffUses (Use *U)
template<int Idx>
Use & Op ()
template<int Idx>
const Use & Op () const

Static Protected Member Functions

template<int Idx, typename U>
static Use & OpFrom (const U *that)

Protected Attributes

Use * OperandList
unsigned NumOperands

Friends

struct HungoffOperandTraits


Detailed Description

Definition at line 46 of file User.h.


Member Typedef Documentation

Definition at line 128 of file User.h.

Definition at line 129 of file User.h.


Constructor & Destructor Documentation

llvm::User::User ( const Type *  ty,
unsigned  vty,
Use *  OpList,
unsigned  NumOps 
) [inline, protected]

Definition at line 65 of file User.h.

llvm::User::~User (  )  [inline]

Definition at line 76 of file User.h.

References NumOperands, OperandList, and llvm::Use::zap().


Member Function Documentation

void * llvm::User::operator new ( size_t  s,
unsigned  Us 
) [protected]

Reimplemented in llvm::CompareConstantExpr.

Definition at line 170 of file Use.cpp.

References End, NumOperands, SaveTempsEnum::Obj, and OperandList.

void * llvm::User::operator new ( size_t  s,
unsigned  Us,
bool  Prefix 
) [protected]

Prefixed allocation - just before the first Use, allocate a NULL pointer. The destructor can detect its presence and readjust the OperandList for deletition.

Definition at line 185 of file Use.cpp.

References End, NumOperands, SaveTempsEnum::Obj, and OperandList.

Use * llvm::User::allocHungoffUses ( unsigned  N  )  const [protected]

void llvm::User::dropHungoffUses ( Use *  U  )  [inline, protected]

void llvm::User::operator delete ( void *  Usr  ) 

operator delete - free memory allocated for User and Use objects

Definition at line 210 of file Use.cpp.

References if(), NumOperands, and OperandList.

void llvm::User::operator delete ( void *  ,
unsigned   
) [inline]

placement delete - required by std, but never called.

Definition at line 83 of file User.h.

void llvm::User::operator delete ( void *  ,
unsigned  ,
bool   
) [inline]

placement delete - required by std, but never called.

Definition at line 87 of file User.h.

template<int Idx, typename U>
static Use& llvm::User::OpFrom ( const U *  that  )  [inline, static, protected]

Definition at line 91 of file User.h.

References Idx.

template<int Idx>
Use& llvm::User::Op (  )  [inline, protected]

template<int Idx>
const Use& llvm::User::Op (  )  const [inline, protected]

Definition at line 99 of file User.h.

Value* llvm::User::getOperand ( unsigned  i  )  const [inline]

Reimplemented in llvm::Constant.

Definition at line 103 of file User.h.

References NumOperands, and OperandList.

Referenced by llvm::AliasSetTracker::add(), llvm::AddCatchInfo(), AddressIsTaken(), AssociativeOpt(), BreakUpSubtract(), llvm::CannotBeNegativeZero(), CheapToScalarize(), llvm::ShuffleVectorInst::clone(), llvm::InsertElementInst::clone(), llvm::ExtractElementInst::clone(), llvm::VAArgInst::clone(), llvm::SelectInst::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::StoreInst::clone(), llvm::LoadInst::clone(), llvm::FreeInst::clone(), llvm::AllocaInst::clone(), llvm::MallocInst::clone(), llvm::CloneLoop(), CollectBSwapParts(), CollectShuffleElements(), CollectSingleShuffleElements(), llvm::ComputeMaskedBits(), llvm::ComputeNumSignBits(), llvm::ConstantFoldInstOperands(), ConvertShiftToMul(), llvm::InsertElementInst::Create(), llvm::ExtractElementInst::Create(), DecomposeSimpleLinearExpr(), dyn_castFoldableMul(), EnforceKnownAlignment(), EvaluateExpression(), EvaluateGEPOffsetExpression(), llvm::SelectionDAGLowering::FindMergedConditions(), FindSingleUseMultiplyFactors(), llvm::FoldBranchToCommonDest(), FoldOperationIntoSelectOperand(), FoldOpIntoSelect(), GatherConstantSetEQs(), GatherConstantSetNEs(), llvm::gep_type_begin(), llvm::DbgDeclareInst::getAddress(), llvm::InsertValueInst::getAggregateOperand(), llvm::MemIntrinsic::getAlignmentCst(), llvm::MemIntrinsic::getAlignmentType(), llvm::AllocationInst::getArraySize(), llvm::CallSite::getCalledValue(), llvm::MSILWriter::getCallSignature(), llvm::DbgStopPointInst::getColumn(), llvm::DbgStopPointInst::getColumnValue(), getConstantEvolvingPHI(), llvm::DbgRegionEndInst::getContext(), llvm::DbgRegionStartInst::getContext(), llvm::DbgStopPointInst::getContext(), llvm::BinaryOperator::getFNegArgument(), llvm::InsertValueInst::getInsertedValueOperand(), llvm::MemIntrinsic::getLength(), llvm::DbgStopPointInst::getLine(), llvm::DbgStopPointInst::getLineValue(), llvm::ShuffleVectorInst::getMaskValue(), llvm::AliasAnalysis::getModRefInfo(), llvm::BinaryOperator::getNegArgument(), llvm::BinaryOperator::getNotArgument(), GetOffsetFromIndex(), llvm::Constant::getOperand(), llvm::GEPOperator::getPointerOperand(), llvm::GetElementPtrInst::getPointerOperand(), llvm::StoreInst::getPointerOperand(), llvm::LoadInst::getPointerOperand(), llvm::FreeInst::getPointerOperand(), llvm::MemIntrinsic::getRawDest(), llvm::MemTransferInst::getRawSource(), getShuffleMask(), llvm::ScalarEvolution::getSignedRange(), GetStringLengthH(), llvm::DbgFuncStartInst::getSubprogram(), llvm::Loop::getTripCount(), llvm::ScalarEvolution::getUnsignedRange(), llvm::MemSetInst::getValue(), llvm::DbgDeclareInst::getVariable(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), llvm::BinaryOperator::init(), InstCombineLoadCast(), InstCombineStoreToCast(), llvm::AllocationInst::isArrayAllocation(), isDynamicConstant(), isEliminableCastPair(), isEquivalentOperation(), isFPIntBitCast(), llvm::Instruction::isIdenticalToWhenDefined(), isInTailCallPosition(), llvm::CastInst::isIntegerCast(), llvm::CastInst::isLosslessCast(), llvm::CastInst::isNoopCast(), isOnlyCopiedFromConstantGlobal(), IsOperandAMemoryOperand(), IsPointerOffset(), isSafeAndProfitableToSinkLoad(), isSafeSROAElementUse(), isSafeToEliminateVarargsCast(), llvm::Instruction::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), IsUserOfGlobalSafeForSRA(), llvm::IntrinsicLowering::LowerIntrinsicCall(), LowerNegateToMultiply(), LowerToBSwap(), llvm::Loop::makeLoopInvariant(), MightBeFoldableInst(), OptimizeAwayTrappingUsesOfLoads(), OptimizeAwayTrappingUsesOfValue(), OptimizeCmpExpression(), OptimizeNoopCopyExpression(), PerformHeapAllocSRoA(), llvm::PointerMayBeCaptured(), llvm::MSILWriter::printAllocaInstruction(), llvm::MSILWriter::printCallInstruction(), llvm::MSILWriter::printInstruction(), llvm::MSILWriter::printIntrinsicCall(), llvm::MSILWriter::printInvokeInstruction(), llvm::MSILWriter::printLocalVariables(), llvm::MSILWriter::printVAArgInstruction(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemapInstruction(), llvm::AliasSetTracker::remove(), ReplaceFPIntrinsicWithCall(), replaceUsesOfWith(), llvm::UnifyFunctionExitNodes::runOnFunction(), llvm::FastISel::SelectOperator(), ShouldBreakUpSubtract(), ShrinkDemandedConstant(), SRAGlobal(), StripDebugInfo(), TryToShrinkGlobalToBoolean(), llvm::UpgradeIntrinsicCall(), ValueIsOnlyUsedLocallyOrStoredToOneGlobal(), llvm::Interpreter::visitAllocationInst(), llvm::Interpreter::visitAShr(), llvm::Interpreter::visitBinaryOperator(), llvm::Interpreter::visitBitCastInst(), 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::visitLShr(), llvm::Interpreter::visitPtrToIntInst(), llvm::Interpreter::visitSelectInst(), llvm::Interpreter::visitSExtInst(), llvm::Interpreter::visitShl(), llvm::Interpreter::visitSIToFPInst(), llvm::Interpreter::visitStoreInst(), llvm::Interpreter::visitSwitchInst(), llvm::Interpreter::visitTruncInst(), llvm::Interpreter::visitUIToFPInst(), llvm::Interpreter::visitVAArgInst(), llvm::Interpreter::visitZExtInst(), and WriteInstruction().

void llvm::User::setOperand ( unsigned  i,
Value *  Val 
) [inline]

const Use& llvm::User::getOperandUse ( unsigned  i  )  const [inline]

Definition at line 114 of file User.h.

References NumOperands, and OperandList.

Use& llvm::User::getOperandUse ( unsigned  i  )  [inline]

Definition at line 118 of file User.h.

References NumOperands, and OperandList.

unsigned llvm::User::getNumOperands (  )  const [inline]

Definition at line 123 of file User.h.

References NumOperands.

Referenced by llvm::AddCatchInfo(), llvm::MachineModuleInfo::AnalyzeModule(), BitCastConstantVector(), llvm::Constant::canTrap(), CheapToScalarize(), llvm::InvokeInst::clone(), llvm::BranchInst::clone(), llvm::ReturnInst::clone(), llvm::CallInst::clone(), llvm::GetElementPtrInst::clone(), llvm::CloneLoop(), llvm::ComputeMaskedBits(), llvm::ConstantFoldInsertValueInstruction(), llvm::ConvertConstant< ConstantStruct, StructType >::convert(), llvm::ConvertConstant< ConstantArray, ArrayType >::convert(), llvm::ConvertConstant< ConstantVector, VectorType >::convert(), llvm::X86IntelAsmPrinter::EmitString(), llvm::AsmPrinter::EmitString(), EvaluateExpression(), EvaluateGEPOffsetExpression(), evaluateICmpRelation(), EvaluateStoreInto(), FindStaticTors(), findUsedValues(), FoldBitCast(), llvm::ConstantArray::getAsString(), llvm::MSILWriter::getCallSignature(), getConstantEvolvingPHI(), llvm::DIDescriptor::getDescriptorField(), llvm::DIDescriptor::getGlobalVariableField(), llvm::ShuffleVectorInst::getMaskValue(), llvm::DIArray::getNumElements(), llvm::GEPOperator::getNumIndices(), llvm::GetElementPtrInst::getNumIndices(), GetOffsetFromIndex(), llvm::Constant::getRelocationInfo(), llvm::ConstantVector::getSplatValue(), llvm::DIDescriptor::getStringField(), GetStringLengthH(), llvm::DIDescriptor::getUInt64Field(), getValType(), llvm::ConstantExpr::getWithOperandReplaced(), llvm::ConstantExpr::getWithOperands(), llvm::GetElementPtrInst::hasAllConstantIndices(), llvm::GetElementPtrInst::hasAllZeroIndices(), llvm::GEPOperator::hasIndices(), llvm::GetElementPtrInst::hasIndices(), llvm::ExecutionEngine::InitializeMemory(), llvm::MachOWriter::InitMem(), llvm::ConstantVector::isAllOnesValue(), llvm::ConstantArray::isCString(), llvm::GlobalVariable::isDeclaration(), isEquivalentOperation(), llvm::Instruction::isIdenticalToWhenDefined(), isInTailCallPosition(), IsPointerOffset(), isSafeSROAElementUse(), llvm::Instruction::isSafeToSpeculativelyExecute(), llvm::Instruction::isSameOperationAs(), llvm::ConstantArray::isString(), IsUserOfGlobalSafeForSRA(), LowerToBSwap(), llvm::Loop::makeLoopInvariant(), llvm::MapValue(), llvm::VariadicOperandTraits< 3 >::op_begin(), llvm::HungoffOperandTraits< 2 >::op_end(), llvm::OperandTraits< User >::operands(), llvm::HungoffOperandTraits< 2 >::operands(), llvm::VariadicOperandTraits< 3 >::operands(), llvm::OptionalOperandTraits< >::operands(), OptimizeAwayTrappingUsesOfValue(), ParseGlobalCtors(), llvm::MSILWriter::printCallInstruction(), llvm::MSILWriter::printConstantExpr(), llvm::MSILWriter::printInstruction(), llvm::MSILWriter::printInvokeInstruction(), llvm::MSILWriter::printStaticConstant(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), RemapInstruction(), RemapOperand(), llvm::SwitchInst::removeCase(), RemoveDeadConstant(), llvm::PHINode::removeIncomingValue(), replaceUsesOfWith(), llvm::GlobalVariable::replaceUsesOfWithOnConstant(), llvm::ConstantExpr::replaceUsesOfWithOnConstant(), llvm::ConstantVector::replaceUsesOfWithOnConstant(), llvm::ConstantStruct::replaceUsesOfWithOnConstant(), llvm::ConstantArray::replaceUsesOfWithOnConstant(), llvm::Constant::replaceUsesOfWithOnConstant(), llvm::MetadataBase::resizeOperands(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), SRAGlobal(), llvm::Interpreter::visitReturnInst(), llvm::Interpreter::visitSwitchInst(), WriteConstantInt(), WriteConstants(), and WriteInstruction().

op_iterator llvm::User::op_begin (  )  [inline]

const_op_iterator llvm::User::op_begin (  )  const [inline]

Definition at line 132 of file User.h.

References OperandList.

op_iterator llvm::User::op_end (  )  [inline]

const_op_iterator llvm::User::op_end (  )  const [inline]

Definition at line 134 of file User.h.

References NumOperands, and OperandList.

void llvm::User::dropAllReferences (  )  [inline]

Reimplemented in llvm::Function, llvm::MDNode, and llvm::NamedMDNode.

Definition at line 144 of file User.h.

References op_begin(), and op_end().

Referenced by llvm::NamedMDNode::dropAllReferences(), and llvm::MDNode::dropAllReferences().

void User::replaceUsesOfWith ( Value *  From,
Value *  To 
)

replaceUsesOfWith - Replaces all references to the "From" definition with references to the "To" definition.

Definition at line 553 of file Value.cpp.

References E, getNumOperands(), getOperand(), and setOperand().

Referenced by llvm::DemoteRegToStack(), and ReplaceUsesOfMallocWithGlobal().

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

Definition at line 155 of file User.h.

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

Reimplemented from llvm::Value.

Reimplemented in 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::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, and llvm::GEPOperator.

Definition at line 156 of file User.h.


Friends And Related Function Documentation

friend struct HungoffOperandTraits [friend]

Definition at line 50 of file User.h.


Member Data Documentation


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