LLVM  mainline
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
llvm::GlobalValue Class Reference

#include <GlobalValue.h>

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

List of all members.

Public Types

enum  LinkageTypes {
  ExternalLinkage = 0, AvailableExternallyLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage,
  WeakAnyLinkage, WeakODRLinkage, AppendingLinkage, InternalLinkage,
  PrivateLinkage, 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...
enum  DLLStorageClassTypes { DefaultStorageClass = 0, DLLImportStorageClass = 1, DLLExportStorageClass = 2 }
 Storage classes of global values for PE targets. More...
enum  ThreadLocalMode {
  NotThreadLocal = 0, GeneralDynamicTLSModel, LocalDynamicTLSModel, InitialExecTLSModel,
  LocalExecTLSModel
}

Public Member Functions

 ~GlobalValue () override
unsigned getAlignment () const
bool hasUnnamedAddr () const
void setUnnamedAddr (bool Val)
bool hasComdat () const
ComdatgetComdat ()
const ComdatgetComdat () const
VisibilityTypes getVisibility () const
bool hasDefaultVisibility () const
bool hasHiddenVisibility () const
bool hasProtectedVisibility () const
void setVisibility (VisibilityTypes V)
bool isThreadLocal () const
 If the value is "Thread Local", its value isn't shared by the threads.
void setThreadLocal (bool Val)
void setThreadLocalMode (ThreadLocalMode Val)
ThreadLocalMode getThreadLocalMode () const
DLLStorageClassTypes getDLLStorageClass () const
bool hasDLLImportStorageClass () const
bool hasDLLExportStorageClass () const
void setDLLStorageClass (DLLStorageClassTypes C)
bool hasSection () const
const char * getSection () const
PointerTypegetType () const
 Global values are always pointers.
TypegetValueType () const
bool hasExternalLinkage () const
bool hasAvailableExternallyLinkage () const
bool hasLinkOnceLinkage () const
bool hasLinkOnceODRLinkage () const
bool hasWeakLinkage () const
bool hasWeakAnyLinkage () const
bool hasWeakODRLinkage () const
bool hasAppendingLinkage () const
bool hasInternalLinkage () const
bool hasPrivateLinkage () const
bool hasLocalLinkage () 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)
 Copy all additional attributes (those not needed to create a GlobalValue) from the GlobalValue Src to this one.
bool isDeclaration () const
 Return true if the primary definition of this global value is outside of the current translation unit.
bool isDeclarationForLinker () const
bool isStrongDefinitionForLinker () const
 Returns true if this global's definition will be the one chosen by the linker.
bool canIncreaseAlignment () const
virtual void removeFromParent ()=0
 This method unlinks 'this' from the containing module, but does not delete it.
virtual void eraseFromParent ()=0
 This method unlinks 'this' from the containing module and deletes it.
ModulegetParent ()
 Get the module that this global value is contained inside of...
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
 If this function's Module is being lazily streamed in functions from disk or some other source, this method can be used to check to see if the function has been read in yet or not.
std::error_code materialize ()
 Make sure this GlobalValue is fully read.

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 isLinkOnceODRLinkage (LinkageTypes Linkage)
static bool isLinkOnceLinkage (LinkageTypes Linkage)
static bool isWeakAnyLinkage (LinkageTypes Linkage)
static bool isWeakODRLinkage (LinkageTypes Linkage)
static bool isWeakLinkage (LinkageTypes Linkage)
static bool isAppendingLinkage (LinkageTypes Linkage)
static bool isInternalLinkage (LinkageTypes Linkage)
static bool isPrivateLinkage (LinkageTypes Linkage)
static bool isLocalLinkage (LinkageTypes Linkage)
static bool isExternalWeakLinkage (LinkageTypes Linkage)
static bool isCommonLinkage (LinkageTypes Linkage)
static bool isDiscardableIfUnused (LinkageTypes Linkage)
 Whether the definition of this global may be discarded if it is not used in its compilation unit.
static bool mayBeOverridden (LinkageTypes Linkage)
 Whether the definition of this global may be replaced by something non-equivalent at link time.
static bool isWeakForLinker (LinkageTypes Linkage)
 Whether the definition of this global may be replaced at link time.
static StringRef getRealLinkageName (StringRef Name)
 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.
static bool classof (const Value *V)

Protected Member Functions

 GlobalValue (Type *Ty, ValueTy VTy, Use *Ops, unsigned NumOps, LinkageTypes Linkage, const Twine &Name, unsigned AddressSpace)
unsigned getGlobalValueSubClassData () const
void setGlobalValueSubClassData (unsigned V)

Protected Attributes

TypeValueType
LinkageTypes Linkage: 5
unsigned Visibility: 2
unsigned UnnamedAddr: 1
unsigned DllStorageClass: 2
unsigned ThreadLocal: 3
Intrinsic::ID IntID
 The intrinsic ID for this subclass (which must be a Function).
ModuleParent

Static Protected Attributes

static const unsigned GlobalValueSubClassDataBits = 19

Friends

class Constant

Detailed Description

Definition at line 35 of file GlobalValue.h.


Member Enumeration Documentation

Storage classes of global values for PE targets.

Enumerator:
DefaultStorageClass 
DLLImportStorageClass 

Function to be imported from DLL.

DLLExportStorageClass 

Function to be accessible from DLL.

Definition at line 61 of file GlobalValue.h.

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.

ExternalWeakLinkage 

ExternalWeak linkage description.

CommonLinkage 

Tentative definitions.

Definition at line 39 of file GlobalValue.h.

Enumerator:
NotThreadLocal 
GeneralDynamicTLSModel 
LocalDynamicTLSModel 
InitialExecTLSModel 
LocalExecTLSModel 

Definition at line 117 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 54 of file GlobalValue.h.


Constructor & Destructor Documentation

llvm::GlobalValue::GlobalValue ( Type Ty,
ValueTy  VTy,
Use Ops,
unsigned  NumOps,
LinkageTypes  Linkage,
const Twine Name,
unsigned  AddressSpace 
) [inline, protected]

Definition at line 68 of file GlobalValue.h.

References llvm::Value::setName().

llvm::GlobalValue::~GlobalValue ( ) [inline, override]

Definition at line 125 of file GlobalValue.h.

References llvm::Constant::removeDeadConstantUsers().


Member Function Documentation

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

Reimplemented from llvm::Constant.

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

Definition at line 365 of file GlobalValue.h.

References llvm::Value::getValueID().

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

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

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

Definition at line 52 of file Globals.cpp.

References getDLLStorageClass(), getVisibility(), hasUnnamedAddr(), setDLLStorageClass(), setUnnamedAddr(), and setVisibility().

Referenced by llvm::orc::cloneGlobalAliasDecl(), and llvm::CloneModule().

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

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

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

Reimplemented in llvm::GlobalObject.

Definition at line 136 of file GlobalValue.h.

References getComdat().

Definition at line 165 of file GlobalValue.h.

References DllStorageClass.

Referenced by copyAttributesFrom(), and getEncodedDLLStorageClass().

static LinkageTypes llvm::GlobalValue::getLinkOnceLinkage ( bool  ODR) [inline, static]

Definition at line 190 of file GlobalValue.h.

References LinkOnceAnyLinkage, and LinkOnceODRLinkage.

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

Definition at line 361 of file GlobalValue.h.

References Parent.

Referenced by AddAlignmentAssumptions(), AllCallersPassInValidPointerForArgument(), llvm::Value::assertModuleIsMaterialized(), callIntrinsic(), llvm::canBeOmittedFromSymbolTable(), llvm::changeToUnreachable(), checkStringCopyLibFuncSignature(), CloneDebugInfoMetadata(), llvm::orc::cloneFunctionDecl(), llvm::orc::cloneGlobalVariableDecl(), combineInstructionsOverFunction(), ComputeLegalValueVTs(), llvm::SanitizerStatReport::create(), llvm::GlobalAlias::create(), llvm::IRBuilderBase::CreateAssumption(), llvm::IRBuilderBase::CreateGCRelocate(), llvm::IRBuilderBase::CreateGCResult(), CreateGCStatepointCallCommon(), CreateGCStatepointInvokeCommon(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilder< true, TargetFolder >::CreateInvariantGroupBarrier(), llvm::createLegacyPMBasicAAResult(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), llvm::createPGOFuncNameVar(), createPopcntIntrinsic(), llvm::AsmPrinter::EmitAlignment(), llvm::AArch64TargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::ARMTargetLowering::emitAtomicCmpXchgNoStoreLLBalance(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::TargetLoweringObjectFileCOFF::emitLinkerFlagsForGlobal(), llvm::HexagonTargetLowering::emitLoadLinked(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::HexagonTargetLowering::emitStoreConditional(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), llvm::GlobalAlias::eraseFromParent(), llvm::GlobalVariable::eraseFromParent(), llvm::Function::eraseFromParent(), llvm::CodeExtractor::extractCodeRegion(), llvm::findAllNVVMAnnotation(), findExternalCalls(), llvm::findOneNVVMAnnotation(), forceRenaming(), generateUnsignedDivisionCode(), llvm::CallSiteBase<>::getCaller(), getComdatGVForCOFF(), llvm::MachineFunction::getDataLayout(), llvm::ScalarEvolution::getDataLayout(), llvm::RegionBase< Tr >::getDepth(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::ExecutionEngine::getMangledName(), llvm::Trace::getModule(), llvm::BasicBlock::getModule(), getModuleFromVal(), llvm::Mangler::getNameWithPrefix(), llvm::CallGraph::getOrInsertFunction(), getParent(), llvm::getPGOFuncName(), llvm::MCJIT::getPointerToFunction(), llvm::NVPTXTargetLowering::getPrototype(), llvm::AArch64TargetLowering::getSafeStackPointerLocation(), llvm::TargetLoweringBase::getSafeStackPointerLocation(), llvm::TargetLoweringObjectFile::getSectionForJumpTable(), llvm::SparcTargetLowering::getSRetArgSize(), llvm::TargetLoweringObjectFile::getSymbolWithGlobalValueBase(), llvm::MipsTargetMachine::getTargetIRAnalysis(), llvm::AMDGPUTargetMachine::getTargetIRAnalysis(), llvm::TargetMachine::getTargetIRAnalysis(), llvm::ARMTargetLowering::getTgtMemIntrinsic(), llvm::GlobalVariable::GlobalVariable(), HandleByValArgument(), hasReturnsTwiceAttr(), INITIALIZE_PASS(), llvm::MIRParserImpl::initializeConstantPool(), initSlots2BasicBlocks(), initSlots2Values(), InlineCallIfPossible(), llvm::InlineFunction(), insertSinCosCall(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSectionImpl(), llvm::isImageReadOnly(), llvm::isImageReadWrite(), llvm::isImageWriteOnly(), llvm::isSampler(), IsSmallObject(), llvm::lintFunction(), LLVMGetNextFunction(), LLVMGetNextGlobal(), LLVMGetPreviousFunction(), LLVMGetPreviousGlobal(), llvm::AsmPrinter::lowerConstant(), llvm::LowerDbgDeclare(), llvm::TargetLowering::LowerToTLSEmulatedModel(), llvm::ARMTargetLowering::makeDMB(), llvm::orc::makeStub(), materialize(), llvm::orc::moveFunctionBody(), llvm::orc::moveGlobalVariableInitializer(), OptimizeGlobalAddressOfMalloc(), parentFunctionOfValue(), PerformHeapAllocSRoA(), llvm::DivergenceAnalysis::print(), llvm::MIRPrinter::print(), llvm::Value::print(), llvm::MachineBasicBlock::print(), llvm::MachineInstr::print(), llvm::MIPrinter::printIRBlockReference(), llvm::GlobalAlias::removeFromParent(), llvm::GlobalVariable::removeFromParent(), llvm::Function::removeFromParent(), llvm::returnTypeIsEligibleForTailCall(), llvm::objcarc::ObjCARCAA::run(), llvm::BasicAA::run(), llvm::TargetLibraryAnalysis::run(), llvm::LazyValueInfo::runOnFunction(), llvm::StackProtector::runOnFunction(), llvm::BasicAAWrapperPass::runOnFunction(), selectELFSectionForGlobal(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), llvm::FunctionLoweringInfo::set(), setUsedInitializer(), SRAGlobal(), SwitchToLookupTable(), TryToShrinkGlobalToBoolean(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), UpgradeX86IntrinsicsWith8BitMask(), and usedInOneFunc().

Definition at line 362 of file GlobalValue.h.

References Parent.

static StringRef llvm::GlobalValue::getRealLinkageName ( StringRef  Name) [inline, static]

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 308 of file GlobalValue.h.

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

Referenced by llvm::DwarfUnit::addLinkageName(), llvm::WinException::endFunclet(), getMCSymbolForMBB(), and sanitizeFunctionName().

const char * GlobalValue::getSection ( ) const
static LinkageTypes llvm::GlobalValue::getWeakLinkage ( bool  ODR) [inline, static]

Definition at line 193 of file GlobalValue.h.

References WeakAnyLinkage, and WeakODRLinkage.

bool llvm::GlobalValue::hasComdat ( ) const [inline]

Definition at line 269 of file GlobalValue.h.

References isLinkOnceODRLinkage(), and Linkage.

Referenced by llvm::canBeOmittedFromSymbolTable(), and doImportAsDefinitionImpl().

Definition at line 143 of file GlobalValue.h.

References ProtectedVisibility, and Visibility.

bool llvm::GlobalValue::hasSection ( ) const [inline]

Definition at line 273 of file GlobalValue.h.

References isWeakAnyLinkage(), and Linkage.

Referenced by doImportAsDefinitionImpl(), and GetImportList().

Definition at line 276 of file GlobalValue.h.

References isWeakODRLinkage(), and Linkage.

static bool llvm::GlobalValue::isAppendingLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 218 of file GlobalValue.h.

References AppendingLinkage.

Referenced by hasAppendingLinkage().

Definition at line 200 of file GlobalValue.h.

References AvailableExternallyLinkage.

Referenced by hasAvailableExternallyLinkage(), and isDiscardableIfUnused().

static bool llvm::GlobalValue::isCommonLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 233 of file GlobalValue.h.

References CommonLinkage.

Referenced by hasCommonLinkage().

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

Definition at line 124 of file Globals.cpp.

References F.

Referenced by addArgumentAttrs(), addNoAliasAttrs(), addNonNullAttrs(), addNoRecurseAttrs(), addNoRecurseAttrsTopDown(), assureFPCallStub(), llvm::Interpreter::callFunction(), checkFunctionMemoryAccess(), cxxDtorIsEmpty(), doImportAsDefinitionImpl(), llvm::ExecutionEngine::emitGlobals(), llvm::AMDGPUAsmPrinter::EmitGlobalVariable(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::TargetLoweringObjectFileCOFF::emitLinkerFlagsForGlobal(), llvm::ExecutionEngine::FindFunctionNamed(), llvm::ExecutionEngine::FindGlobalVariableNamed(), llvm::MCJIT::findModuleForSymbol(), getCalledFunction(), llvm::GCModuleInfo::getFunctionInfo(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::MCJIT::getPointerToFunction(), llvm::TargetMachine::getTLSModel(), llvm::GlobalVariable::hasInitializer(), llvm::PPCSubtarget::hasLazyResolverStub(), llvm::InlineFunction(), invokeFunctionPass(), isDeclarationForLinker(), isExternallyVisible(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSectionImpl(), isReportingError(), llvm::lintFunction(), llvm::orc::makeStub(), llvm::orc::moveFunctionBody(), predictUseListOrder(), llvm::Inliner::removeDeadFunctions(), llvm::FPPassManager::runOnFunction(), llvm::Inliner::runOnSCC(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), stripDeadPrototypes(), llvm::verifyFunction(), llvm::Interpreter::visitCallSite(), WritePerModuleFunctionSummary(), and WriteValueSymbolTable().

static bool llvm::GlobalValue::isDiscardableIfUnused ( LinkageTypes  Linkage) [inline, static]

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

Definition at line 239 of file GlobalValue.h.

References isAvailableExternallyLinkage(), isLinkOnceLinkage(), and isLocalLinkage().

Referenced by isGOTEquivalentCandidate(), and makeVisible().

Definition at line 293 of file GlobalValue.h.

References Linkage.

static bool llvm::GlobalValue::isExternalLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 197 of file GlobalValue.h.

References ExternalLinkage.

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

static bool llvm::GlobalValue::isExternalWeakLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 230 of file GlobalValue.h.

References ExternalWeakLinkage.

Referenced by hasExternalWeakLinkage().

static bool llvm::GlobalValue::isInternalLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 221 of file GlobalValue.h.

References InternalLinkage.

Referenced by hasInternalLinkage(), and isLocalLinkage().

static bool llvm::GlobalValue::isLinkOnceLinkage ( LinkageTypes  Linkage) [inline, static]
static bool llvm::GlobalValue::isLinkOnceODRLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 203 of file GlobalValue.h.

References LinkOnceODRLinkage.

Referenced by hasLinkOnceODRLinkage().

static bool llvm::GlobalValue::isLocalLinkage ( LinkageTypes  Linkage) [inline, static]

If this function's Module is being lazily streamed in functions from disk or some other source, this method can be used to check to see if the function has been read in yet or not.

Reimplemented in llvm::Function.

Definition at line 31 of file Globals.cpp.

References F.

static bool llvm::GlobalValue::isPrivateLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 224 of file GlobalValue.h.

References PrivateLinkage.

Referenced by hasPrivateLinkage(), and isLocalLinkage().

static bool llvm::GlobalValue::isWeakAnyLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 209 of file GlobalValue.h.

References WeakAnyLinkage.

Referenced by hasWeakAnyLinkage(), and isWeakLinkage().

static bool llvm::GlobalValue::isWeakForLinker ( LinkageTypes  Linkage) [inline, static]

Whether the definition of this global may be replaced at link time.

NB: Using this method outside of the code generators is almost always a mistake: when working at the IR level use mayBeOverridden instead as it knows about ODR semantics.

Definition at line 256 of file GlobalValue.h.

References CommonLinkage, ExternalWeakLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage, WeakAnyLinkage, and WeakODRLinkage.

Referenced by llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFile::shouldPutJumpTableInFunctionSection().

Definition at line 299 of file GlobalValue.h.

References isWeakForLinker(), and Linkage.

Referenced by isStrongDefinitionForLinker(), and isWeakForLinker().

static bool llvm::GlobalValue::isWeakLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 215 of file GlobalValue.h.

References isWeakAnyLinkage(), and isWeakODRLinkage().

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

static bool llvm::GlobalValue::isWeakODRLinkage ( LinkageTypes  Linkage) [inline, static]

Definition at line 212 of file GlobalValue.h.

References WeakODRLinkage.

Referenced by hasWeakODRLinkage(), and isWeakLinkage().

std::error_code GlobalValue::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 GetImportList(), and llvm::legacy::FunctionPassManager::run().

static bool llvm::GlobalValue::mayBeOverridden ( LinkageTypes  Linkage) [inline, static]

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 247 of file GlobalValue.h.

References CommonLinkage, ExternalWeakLinkage, LinkOnceAnyLinkage, and WeakAnyLinkage.

Referenced by addArgumentAttrs(), addNoAliasAttrs(), addNonNullAttrs(), checkFunctionMemoryAccess(), llvm::getInlineCost(), and llvm::ObjectSizeOffsetVisitor::visitGlobalAlias().

Definition at line 297 of file GlobalValue.h.

References Linkage, and mayBeOverridden().

Referenced by llvm::GlobalVariable::hasDefinitiveInitializer(), and mayBeOverridden().

virtual void llvm::GlobalValue::removeFromParent ( ) [pure virtual]

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

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

Definition at line 174 of file GlobalValue.h.

References C, and DllStorageClass.

Referenced by copyAttributesFrom(), and upgradeDLLImportExportLinkage().

void llvm::GlobalValue::setThreadLocal ( bool  Val) [inline]

Definition at line 154 of file GlobalValue.h.

References GeneralDynamicTLSModel, NotThreadLocal, and setThreadLocalMode().

void llvm::GlobalValue::setUnnamedAddr ( bool  Val) [inline]

Friends And Related Function Documentation

friend class Constant [friend]

Definition at line 94 of file GlobalValue.h.


Member Data Documentation

Definition at line 87 of file GlobalValue.h.

Referenced by setGlobalValueSubClassData().

The intrinsic ID for this subclass (which must be a Function).

This member is defined by this class, but not used for anything. Subclasses can use it to store their intrinsic ID, if they have one.

This is stored here to save space in Function on 64-bit hosts.

Definition at line 105 of file GlobalValue.h.

Referenced by llvm::Function::getIntrinsicID(), and llvm::Function::recalculateIntrinsicID().

Definition at line 115 of file GlobalValue.h.

Referenced by canIncreaseAlignment(), and getParent().

Definition at line 85 of file GlobalValue.h.

Referenced by getThreadLocalMode().

Definition at line 82 of file GlobalValue.h.

Referenced by hasUnnamedAddr(), and setUnnamedAddr().

Definition at line 77 of file GlobalValue.h.

Referenced by getValueType().


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