LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
llvm::GlobalValue Class Referenceabstract

#include <GlobalValue.h>

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

Public Types

enum  LinkageTypes {
  ExternalLinkage = 0, AvailableExternallyLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage,
  WeakAnyLinkage, WeakODRLinkage, AppendingLinkage, InternalLinkage,
  PrivateLinkage, LinkerPrivateLinkage, LinkerPrivateWeakLinkage, DLLImportLinkage,
  DLLExportLinkage, ExternalWeakLinkage, CommonLinkage
}
 An enumeration for the kinds of linkage for global values. More...
 
enum  VisibilityTypes { DefaultVisibility = 0, HiddenVisibility, ProtectedVisibility }
 An enumeration for the kinds of visibility of global values. More...
 
- Public Types inherited from llvm::Constant
enum  PossibleRelocationsTy { NoRelocation = 0, LocalRelocation = 1, GlobalRelocations = 2 }
 
- Public Types inherited from llvm::User
typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
- Public Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 

Public Member Functions

 ~GlobalValue ()
 
unsigned getAlignment () const
 
void setAlignment (unsigned Align)
 
bool hasUnnamedAddr () const
 
void setUnnamedAddr (bool Val)
 
VisibilityTypes getVisibility () const
 
bool hasDefaultVisibility () const
 
bool hasHiddenVisibility () const
 
bool hasProtectedVisibility () const
 
void setVisibility (VisibilityTypes V)
 
bool hasSection () const
 
const std::string & getSection () const
 
void setSection (StringRef S)
 
bool use_empty_except_constants ()
 Determine if the usage of this global value is empty except for transitively dead constants. More...
 
PointerTypegetType () const
 getType - Global values are always pointers. More...
 
bool hasExternalLinkage () const
 
bool hasAvailableExternallyLinkage () const
 
bool hasLinkOnceLinkage () const
 
bool hasWeakLinkage () const
 
bool hasAppendingLinkage () const
 
bool hasInternalLinkage () const
 
bool hasPrivateLinkage () const
 
bool hasLinkerPrivateLinkage () const
 
bool hasLinkerPrivateWeakLinkage () const
 
bool hasLocalLinkage () const
 
bool hasDLLImportLinkage () const
 
bool hasDLLExportLinkage () const
 
bool hasExternalWeakLinkage () const
 
bool hasCommonLinkage () const
 
void setLinkage (LinkageTypes LT)
 
LinkageTypes getLinkage () const
 
bool isDiscardableIfUnused () const
 
bool mayBeOverridden () const
 
bool isWeakForLinker () const
 
virtual void copyAttributesFrom (const GlobalValue *Src)
 
virtual void destroyConstant ()
 Override from Constant class. More...
 
bool isDeclaration () const
 
virtual void removeFromParent ()=0
 
virtual void eraseFromParent ()=0
 
ModulegetParent ()
 
const ModulegetParent () const
 
Materialization

Materialization is used to construct functions only as they're needed. This is useful to reduce memory usage in LLVM or parsing work done by the BitcodeReader to load the Module.

bool isMaterializable () const
 
bool isDematerializable () const
 
bool Materialize (std::string *ErrInfo=0)
 
void Dematerialize ()
 
- Public Member Functions inherited from llvm::Constant
bool isNullValue () const
 
bool isAllOnesValue () const
 
bool isNegativeZeroValue () const
 
bool isZeroValue () const
 Return true if the value is negative zero or null value. More...
 
bool canTrap () const
 
bool isThreadDependent () const
 isThreadDependent - Return true if the value can vary between threads. More...
 
bool isConstantUsed () const
 
PossibleRelocationsTy getRelocationInfo () const
 
ConstantgetAggregateElement (unsigned Elt) const
 
ConstantgetAggregateElement (Constant *Elt) const
 
ConstantgetSplatValue () const
 
const APIntgetUniqueInteger () const
 
virtual void replaceUsesOfWithOnConstant (Value *, Value *, Use *)
 
void removeDeadConstantUsers () const
 
- Public Member Functions inherited from llvm::User
 ~User ()
 
void operator delete (void *Usr)
 operator delete - free memory allocated for User and Use objects More...
 
void operator delete (void *, unsigned)
 placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 placement delete - required by std, but never called. More...
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (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
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
void dropAllReferences ()
 
void replaceUsesOfWith (Value *From, Value *To)
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_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
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 

Static Public Member Functions

static LinkageTypes getLinkOnceLinkage (bool ODR)
 
static LinkageTypes getWeakLinkage (bool ODR)
 
static bool isExternalLinkage (LinkageTypes Linkage)
 
static bool isAvailableExternallyLinkage (LinkageTypes Linkage)
 
static bool isLinkOnceLinkage (LinkageTypes Linkage)
 
static bool isWeakLinkage (LinkageTypes Linkage)
 
static bool isAppendingLinkage (LinkageTypes Linkage)
 
static bool isInternalLinkage (LinkageTypes Linkage)
 
static bool isPrivateLinkage (LinkageTypes Linkage)
 
static bool isLinkerPrivateLinkage (LinkageTypes Linkage)
 
static bool isLinkerPrivateWeakLinkage (LinkageTypes Linkage)
 
static bool isLocalLinkage (LinkageTypes Linkage)
 
static bool isDLLImportLinkage (LinkageTypes Linkage)
 
static bool isDLLExportLinkage (LinkageTypes Linkage)
 
static bool isExternalWeakLinkage (LinkageTypes Linkage)
 
static bool isCommonLinkage (LinkageTypes Linkage)
 
static bool isDiscardableIfUnused (LinkageTypes Linkage)
 
static bool mayBeOverridden (LinkageTypes Linkage)
 
static bool isWeakForLinker (LinkageTypes Linkage)
 
static StringRef getRealLinkageName (StringRef Name)
 
static bool classof (const Value *V)
 
- Static Public Member Functions inherited from llvm::Constant
static bool classof (const Value *V)
 
static ConstantgetNullValue (Type *Ty)
 
static ConstantgetAllOnesValue (Type *Ty)
 Get the all ones value. More...
 
static ConstantgetIntegerValue (Type *Ty, const APInt &V)
 
- Static Public Member Functions inherited from llvm::User
static bool classof (const Value *V)
 

Protected Member Functions

 GlobalValue (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps, LinkageTypes linkage, const Twine &Name)
 
- Protected Member Functions inherited from llvm::Constant
 Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
 
void destroyConstantImpl ()
 
- Protected Member Functions inherited from llvm::User
void * operator new (size_t s, unsigned Us)
 
 User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
 
UseallocHungoffUses (unsigned) const
 
void dropHungoffUses ()
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 

Protected Attributes

LinkageTypes Linkage: 5
 
unsigned Visibility: 2
 
unsigned Alignment: 16
 
unsigned UnnamedAddr: 1
 
ModuleParent
 
std::string Section
 
- Protected Attributes inherited from llvm::User
UseOperandList
 
unsigned NumOperands
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Additional Inherited Members

- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 

Detailed Description

Definition at line 29 of file GlobalValue.h.

Member Enumeration Documentation

An enumeration for the kinds of linkage for global values.

Enumerator
ExternalLinkage 

Externally visible function.

AvailableExternallyLinkage 

Available for inspection, not emission.

LinkOnceAnyLinkage 

Keep one copy of function when linking (inline)

LinkOnceODRLinkage 

Same, but only replaced by something equivalent.

WeakAnyLinkage 

Keep one copy of named function when linking (weak)

WeakODRLinkage 

Same, but only replaced by something equivalent.

AppendingLinkage 

Special purpose, only applies to global arrays.

InternalLinkage 

Rename collisions when linking (static functions).

PrivateLinkage 

Like Internal, but omit from symbol table.

LinkerPrivateLinkage 

Like Private, but linker removes.

LinkerPrivateWeakLinkage 

Like LinkerPrivate, but weak.

DLLImportLinkage 

Function to be imported from DLL.

DLLExportLinkage 

Function to be accessible from DLL.

ExternalWeakLinkage 

ExternalWeak linkage description.

CommonLinkage 

Tentative definitions.

Definition at line 33 of file GlobalValue.h.

An enumeration for the kinds of visibility of global values.

Enumerator
DefaultVisibility 

The GV is visible.

HiddenVisibility 

The GV is hidden.

ProtectedVisibility 

The GV is protected.

Definition at line 52 of file GlobalValue.h.

Constructor & Destructor Documentation

llvm::GlobalValue::GlobalValue ( Type ty,
ValueTy  vty,
Use Ops,
unsigned  NumOps,
LinkageTypes  linkage,
const Twine Name 
)
inlineprotected

Definition at line 59 of file GlobalValue.h.

References llvm::Value::setName().

llvm::GlobalValue::~GlobalValue ( )
inline

Definition at line 75 of file GlobalValue.h.

References llvm::Constant::removeDeadConstantUsers().

Member Function Documentation

static bool llvm::GlobalValue::classof ( const Value V)
inlinestatic
void GlobalValue::copyAttributesFrom ( const GlobalValue Src)
virtual

copyAttributesFrom - copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to this one.

Reimplemented in llvm::Function, and llvm::GlobalVariable.

Definition at line 51 of file Globals.cpp.

References getAlignment(), getSection(), getVisibility(), hasUnnamedAddr(), setAlignment(), setSection(), setUnnamedAddr(), and setVisibility().

Referenced by llvm::CloneModule(), llvm::GlobalVariable::copyAttributesFrom(), llvm::Function::copyAttributesFrom(), and copyGVAttributes().

void GlobalValue::Dematerialize ( )

Dematerialize - If this GlobalValue is read in, and if the GVMaterializer supports it, release the memory for the function, and set it up to be materialized lazily. If !isDematerializable(), this method is a noop.

Definition at line 39 of file Globals.cpp.

References llvm::Module::Dematerialize(), and getParent().

void GlobalValue::destroyConstant ( )
virtual

Override from Constant class.

Override destroyConstant to make sure it doesn't get called on GlobalValue's because they shouldn't be treated like other constants.

Reimplemented from llvm::Constant.

Definition at line 45 of file Globals.cpp.

References llvm_unreachable.

virtual void llvm::GlobalValue::eraseFromParent ( )
pure virtual

eraseFromParent - This method unlinks 'this' from the containing module and deletes it.

Implemented in llvm::Function, llvm::GlobalVariable, and llvm::GlobalAlias.

unsigned llvm::GlobalValue::getAlignment ( ) const
inline
LinkageTypes llvm::GlobalValue::getLinkage ( ) const
inline
static LinkageTypes llvm::GlobalValue::getLinkOnceLinkage ( bool  ODR)
inlinestatic

Definition at line 111 of file GlobalValue.h.

References LinkOnceAnyLinkage, and LinkOnceODRLinkage.

Module* llvm::GlobalValue::getParent ( )
inline

getParent - Get the module that this global value is contained inside of...

Definition at line 286 of file GlobalValue.h.

References Parent.

Referenced by changeToUnreachable(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), Dematerialize(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::AsmPrinter::EmitFunctionHeader(), llvm::EmitFWrite(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitPutChar(), llvm::EmitPutS(), llvm::EmitStrChr(), llvm::EmitStrCpy(), llvm::EmitStrLen(), llvm::EmitStrNCmp(), llvm::EmitStrNCpy(), llvm::EmitStrNLen(), llvm::EmitUnaryFloatFnCall(), llvm::GlobalAlias::eraseFromParent(), llvm::GlobalVariable::eraseFromParent(), llvm::Function::eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), llvm::findAllNVVMAnnotation(), llvm::findOneNVVMAnnotation(), forceRenaming(), GenerateARCBBEntranceAnnotation(), GenerateARCBBTerminatorAnnotation(), generateUnsignedDivisionCode(), llvm::CallSiteBase< Function, Value, User, Instruction, CallInst, InvokeInst, User::op_iterator >::getCaller(), llvm::GCModuleInfo::getFunctionInfo(), llvm::Trace::getModule(), getModuleFromVal(), llvm::CallGraph::getOrInsertFunction(), getParent(), llvm::MCJIT::getPointerToFunction(), llvm::SparcTargetLowering::getSRetArgSize(), llvm::GlobalVariable::GlobalVariable(), HandleByValArgument(), hasReturnsTwiceAttr(), INITIALIZE_PASS(), llvm::InlineFunction(), InstallGlobalCtors(), llvm::AnalysisManager::invalidateAll(), isDematerializable(), llvm::isImageReadOnly(), llvm::isImageWriteOnly(), llvm::SpecialCaseList::isIn(), isMaterializable(), llvm::isSampler(), llvm::lintFunction(), LLVMGetNextFunction(), LLVMGetNextGlobal(), LLVMGetPreviousFunction(), LLVMGetPreviousGlobal(), nvptx::LowerConstant(), lowerConstant(), llvm::LowerDbgDeclare(), llvm::IntrinsicLowering::LowerToByteSwap(), Materialize(), OptimizeGlobalAddressOfMalloc(), PerformHeapAllocSRoA(), llvm::Value::print(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), PrintOps(), ProcessUAddIdiom(), ProcessUGT_ADDCST_ADD(), promoteSingleBlockAlloca(), llvm::GlobalAlias::removeFromParent(), llvm::GlobalVariable::removeFromParent(), llvm::Function::removeFromParent(), ReplaceCallWith(), rewriteSingleStoreAlloca(), llvm::JIT::runFunction(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::StackProtector::runOnFunction(), setUsedInitializer(), SRAGlobal(), SwitchToLookupTable(), TryToShrinkGlobalToBoolean(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), usedInOneFunc(), llvm::verifyFunction(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFPTrunc().

const Module* llvm::GlobalValue::getParent ( ) const
inline

Definition at line 287 of file GlobalValue.h.

References Parent.

static StringRef llvm::GlobalValue::getRealLinkageName ( StringRef  Name)
inlinestatic

getRealLinkageName - If special LLVM prefix that is used to inform the asm printer to not emit usual symbol prefix before the symbol name is used then return linkage name after skipping this special LLVM prefix.

Definition at line 235 of file GlobalValue.h.

References llvm::StringRef::empty(), and llvm::StringRef::substr().

Referenced by llvm::CompileUnit::createGlobalVariableDIE(), fixupSubprogramName(), and llvm::CompileUnit::getOrCreateSubprogramDIE().

const std::string& llvm::GlobalValue::getSection ( ) const
inline
PointerType* llvm::GlobalValue::getType ( ) const
inline
VisibilityTypes llvm::GlobalValue::getVisibility ( ) const
inline
static LinkageTypes llvm::GlobalValue::getWeakLinkage ( bool  ODR)
inlinestatic

Definition at line 114 of file GlobalValue.h.

References WeakAnyLinkage, and WeakODRLinkage.

bool llvm::GlobalValue::hasAppendingLinkage ( ) const
inline
bool llvm::GlobalValue::hasAvailableExternallyLinkage ( ) const
inline
bool llvm::GlobalValue::hasCommonLinkage ( ) const
inline
bool llvm::GlobalValue::hasDefaultVisibility ( ) const
inline

Definition at line 88 of file GlobalValue.h.

References DefaultVisibility, and Visibility.

Referenced by bindsLocally(), and llvm::X86Subtarget::ClassifyGlobalReference().

bool llvm::GlobalValue::hasDLLExportLinkage ( ) const
inline

Definition at line 213 of file GlobalValue.h.

References isDLLExportLinkage(), and Linkage.

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

bool llvm::GlobalValue::hasDLLImportLinkage ( ) const
inline
bool llvm::GlobalValue::hasExternalLinkage ( ) const
inline
bool llvm::GlobalValue::hasExternalWeakLinkage ( ) const
inline
bool llvm::GlobalValue::hasHiddenVisibility ( ) const
inline
bool llvm::GlobalValue::hasInternalLinkage ( ) const
inline
bool llvm::GlobalValue::hasLinkerPrivateLinkage ( ) const
inline

Definition at line 207 of file GlobalValue.h.

References isLinkerPrivateLinkage(), and Linkage.

Referenced by llvm::Mangler::getNameWithPrefix().

bool llvm::GlobalValue::hasLinkerPrivateWeakLinkage ( ) const
inline

Definition at line 208 of file GlobalValue.h.

References isLinkerPrivateWeakLinkage(), and Linkage.

Referenced by llvm::Mangler::getNameWithPrefix().

bool llvm::GlobalValue::hasLinkOnceLinkage ( ) const
inline
bool llvm::GlobalValue::hasLocalLinkage ( ) const
inline
bool llvm::GlobalValue::hasPrivateLinkage ( ) const
inline

Definition at line 206 of file GlobalValue.h.

References isPrivateLinkage(), and Linkage.

Referenced by llvm::Mangler::getNameWithPrefix(), and isLeakCheckerRoot().

bool llvm::GlobalValue::hasProtectedVisibility ( ) const
inline

Definition at line 90 of file GlobalValue.h.

References ProtectedVisibility, and Visibility.

bool llvm::GlobalValue::hasSection ( ) const
inline
bool llvm::GlobalValue::hasUnnamedAddr ( ) const
inline
bool llvm::GlobalValue::hasWeakLinkage ( ) const
inline

Definition at line 201 of file GlobalValue.h.

References isWeakLinkage(), and Linkage.

Referenced by llvm::PPCSubtarget::hasLazyResolverStub().

static bool llvm::GlobalValue::isAppendingLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 130 of file GlobalValue.h.

References AppendingLinkage.

Referenced by hasAppendingLinkage().

static bool llvm::GlobalValue::isAvailableExternallyLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 121 of file GlobalValue.h.

References AvailableExternallyLinkage.

Referenced by hasAvailableExternallyLinkage().

static bool llvm::GlobalValue::isCommonLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 158 of file GlobalValue.h.

References CommonLinkage.

Referenced by hasCommonLinkage().

bool GlobalValue::isDeclaration ( ) const

isDeclaration - Return true if the primary definition of this global value is outside of the current translation unit.

Definition at line 66 of file Globals.cpp.

References F().

Referenced by assureFPCallStub(), llvm::Interpreter::callFunction(), llvm::X86Subtarget::ClassifyGlobalReference(), cxxDtorIsEmpty(), llvm::AsmPrinter::doFinalization(), llvm::ExecutionEngine::emitGlobals(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::MCJIT::findModuleForSymbol(), getCalledFunction(), llvm::GCModuleInfo::getFunctionInfo(), llvm::Inliner::getInlineThreshold(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), llvm::MCJIT::getPointerToFunction(), llvm::TargetMachine::getTLSModel(), llvm::ARMSubtarget::GVIsIndirectSymbol(), llvm::GlobalVariable::hasInitializer(), llvm::PPCSubtarget::hasLazyResolverStub(), INITIALIZE_PASS(), llvm::InlineFunction(), isDeclaration(), llvm::BitcodeReader::isDematerializable(), llvm::isFreeCall(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::BitcodeReader::isMaterializable(), isNonGhostDeclaration(), llvm::TargetLowering::isOffsetFoldingLegal(), llvm::lintFunction(), llvm::AssemblyWriter::printFunction(), llvm::Inliner::removeDeadFunctions(), llvm::FPPassManager::runOnFunction(), llvm::MipsOs16::runOnModule(), llvm::Mips16HardFloat::runOnModule(), llvm::Inliner::runOnSCC(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), shouldInternalize(), llvm::verifyFunction(), and llvm::Interpreter::visitCallSite().

bool GlobalValue::isDematerializable ( ) const

isDematerializable - Returns true if this function was loaded from a GVMaterializer that's still attached to its Module and that knows how to dematerialize the function.

Definition at line 33 of file Globals.cpp.

References getParent(), and llvm::Module::isDematerializable().

static bool llvm::GlobalValue::isDiscardableIfUnused ( LinkageTypes  Linkage)
inlinestatic

isDiscardableIfUnused - Whether the definition of this global may be discarded if it is not used in its compilation unit.

Definition at line 164 of file GlobalValue.h.

References isLinkOnceLinkage(), and isLocalLinkage().

Referenced by makeVisible().

bool llvm::GlobalValue::isDiscardableIfUnused ( ) const
inline

Definition at line 220 of file GlobalValue.h.

References Linkage.

static bool llvm::GlobalValue::isDLLExportLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 152 of file GlobalValue.h.

References DLLExportLinkage.

Referenced by hasDLLExportLinkage().

static bool llvm::GlobalValue::isDLLImportLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 149 of file GlobalValue.h.

References DLLImportLinkage.

Referenced by hasDLLImportLinkage().

static bool llvm::GlobalValue::isExternalLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 118 of file GlobalValue.h.

References ExternalLinkage.

Referenced by hasExternalLinkage(), and llvm::GlobalAlias::isValidLinkage().

static bool llvm::GlobalValue::isExternalWeakLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 155 of file GlobalValue.h.

References ExternalWeakLinkage.

Referenced by hasExternalWeakLinkage().

static bool llvm::GlobalValue::isInternalLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 133 of file GlobalValue.h.

References InternalLinkage.

Referenced by hasInternalLinkage(), and isLocalLinkage().

static bool llvm::GlobalValue::isLinkerPrivateLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 139 of file GlobalValue.h.

References LinkerPrivateLinkage.

Referenced by hasLinkerPrivateLinkage(), and isLocalLinkage().

static bool llvm::GlobalValue::isLinkerPrivateWeakLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 142 of file GlobalValue.h.

References LinkerPrivateWeakLinkage.

Referenced by hasLinkerPrivateWeakLinkage(), and isLocalLinkage().

static bool llvm::GlobalValue::isLinkOnceLinkage ( LinkageTypes  Linkage)
inlinestatic
static bool llvm::GlobalValue::isLocalLinkage ( LinkageTypes  Linkage)
inlinestatic
bool GlobalValue::isMaterializable ( ) const
static bool llvm::GlobalValue::isPrivateLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 136 of file GlobalValue.h.

References PrivateLinkage.

Referenced by hasPrivateLinkage(), and isLocalLinkage().

static bool llvm::GlobalValue::isWeakForLinker ( LinkageTypes  Linkage)
inlinestatic
bool llvm::GlobalValue::isWeakForLinker ( ) const
inline

Definition at line 226 of file GlobalValue.h.

References isWeakForLinker(), and Linkage.

Referenced by llvm::GlobalVariable::hasUniqueInitializer(), and isWeakForLinker().

static bool llvm::GlobalValue::isWeakLinkage ( LinkageTypes  Linkage)
inlinestatic

Definition at line 127 of file GlobalValue.h.

References WeakAnyLinkage, and WeakODRLinkage.

Referenced by hasWeakLinkage(), and llvm::GlobalAlias::isValidLinkage().

bool GlobalValue::Materialize ( std::string *  ErrInfo = 0)

Materialize - make sure this GlobalValue is fully read. If the module is corrupt, this returns true and fills in the optional string with information about the problem. If successful, this returns false.

Definition at line 36 of file Globals.cpp.

References getParent(), and llvm::Module::Materialize().

Referenced by llvm::JIT::getPointerToFunction(), llvm::BitcodeReader::materializeForwardReferencedFunctions(), and llvm::legacy::FunctionPassManager::run().

static bool llvm::GlobalValue::mayBeOverridden ( LinkageTypes  Linkage)
inlinestatic

mayBeOverridden - Whether the definition of this global may be replaced by something non-equivalent at link time. For example, if a function has weak linkage then the code defining it may be replaced by different code.

Definition at line 171 of file GlobalValue.h.

References CommonLinkage, ExternalWeakLinkage, LinkerPrivateWeakLinkage, LinkOnceAnyLinkage, and WeakAnyLinkage.

Referenced by llvm::InlineCostAnalysis::getInlineCost(), and llvm::ObjectSizeOffsetVisitor::visitGlobalAlias().

bool llvm::GlobalValue::mayBeOverridden ( ) const
inline
virtual void llvm::GlobalValue::removeFromParent ( )
pure virtual

removeFromParent - This method unlinks 'this' from the containing module, but does not delete it.

Implemented in llvm::Function, llvm::GlobalVariable, and llvm::GlobalAlias.

void GlobalValue::setAlignment ( unsigned  Align)

Definition at line 58 of file Globals.cpp.

References Alignment, getAlignment(), and llvm::Log2_32().

Referenced by copyAttributesFrom(), copyGVAttributes(), and SRAGlobal().

void llvm::GlobalValue::setLinkage ( LinkageTypes  LT)
inline

Definition at line 217 of file GlobalValue.h.

References Linkage, and llvm::A64CC::LT.

Referenced by llvm::Function::deleteBody(), LLVMSetLinkage(), and makeVisible().

void llvm::GlobalValue::setSection ( StringRef  S)
inline

Definition at line 97 of file GlobalValue.h.

References Section.

Referenced by assureFPCallStub(), copyAttributesFrom(), createFPFnStub(), and setUsedInitializer().

void llvm::GlobalValue::setUnnamedAddr ( bool  Val)
inline
void llvm::GlobalValue::setVisibility ( VisibilityTypes  V)
inline

Definition at line 93 of file GlobalValue.h.

References Visibility.

Referenced by copyAttributesFrom(), and makeVisible().

bool llvm::GlobalValue::use_empty_except_constants ( )

Determine if the usage of this global value is empty except for transitively dead constants.

If the usage is empty (except transitively dead constants), then this global value can be safely deleted since the destructor will delete the dead constants as well.

Member Data Documentation

unsigned llvm::GlobalValue::Alignment
protected

Definition at line 70 of file GlobalValue.h.

Referenced by getAlignment(), and setAlignment().

LinkageTypes llvm::GlobalValue::Linkage
protected
Module* llvm::GlobalValue::Parent
protected

Definition at line 72 of file GlobalValue.h.

Referenced by getParent().

std::string llvm::GlobalValue::Section
protected

Definition at line 73 of file GlobalValue.h.

Referenced by getSection(), hasSection(), and setSection().

unsigned llvm::GlobalValue::UnnamedAddr
protected

Definition at line 71 of file GlobalValue.h.

Referenced by hasUnnamedAddr(), and setUnnamedAddr().

unsigned llvm::GlobalValue::Visibility
protected

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