LLVM API Documentation
#include <GlobalValue.h>
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... | |
PointerType * | getType () 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 |
Module * | getParent () |
const Module * | getParent () 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 () |
![]() | |
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 |
Constant * | getAggregateElement (unsigned Elt) const |
Constant * | getAggregateElement (Constant *Elt) const |
Constant * | getSplatValue () const |
const APInt & | getUniqueInteger () const |
virtual void | replaceUsesOfWithOnConstant (Value *, Value *, Use *) |
void | removeDeadConstantUsers () const |
![]() | |
~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... | |
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 |
value_op_iterator | value_op_begin () |
value_op_iterator | value_op_end () |
void | dropAllReferences () |
void | replaceUsesOfWith (Value *From, Value *To) |
![]() | |
virtual | ~Value () |
void | dump () const |
dump - Support for debugging, callable in GDB: V->dump() More... | |
void | print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const |
Type * | getType () const |
LLVMContext & | getContext () const |
All values hold a context through their type. More... | |
bool | hasName () const |
ValueName * | getValueName () 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 |
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 |
unsigned | getRawSubclassOptionalData () const |
void | clearSubclassOptionalData () |
bool | hasSameSubclassOptionalData (const Value *V) const |
void | intersectOptionalDataWith (const Value *V) |
bool | hasValueHandle () const |
Value * | stripPointerCasts () |
Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More... | |
const Value * | stripPointerCasts () const |
Value * | stripPointerCastsNoFollowAliases () |
Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More... | |
const Value * | stripPointerCastsNoFollowAliases () const |
Value * | stripInBoundsConstantOffsets () |
Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More... | |
const Value * | stripInBoundsConstantOffsets () const |
Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) |
Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More... | |
const Value * | stripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const |
Value * | stripInBoundsOffsets () |
Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More... | |
const Value * | stripInBoundsOffsets () const |
bool | isDereferenceablePointer () const |
Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) |
const Value * | DoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const |
void | mutateType (Type *Ty) |
Protected Member Functions | |
GlobalValue (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps, LinkageTypes linkage, const Twine &Name) | |
![]() | |
Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps) | |
void | destroyConstantImpl () |
![]() | |
void * | operator new (size_t s, unsigned Us) |
User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps) | |
Use * | allocHungoffUses (unsigned) const |
void | dropHungoffUses () |
template<int Idx> | |
Use & | Op () |
template<int Idx> | |
const Use & | Op () const |
![]() | |
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 |
Module * | Parent |
std::string | Section |
![]() | |
Use * | OperandList |
unsigned | NumOperands |
![]() | |
unsigned char | SubclassOptionalData: 7 |
Additional Inherited Members | |
![]() | |
static const unsigned | MaximumAlignment = 1u << 29 |
![]() | |
template<int Idx, typename U > | |
static Use & | OpFrom (const U *that) |
Definition at line 29 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. |
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.
|
inlineprotected |
Definition at line 59 of file GlobalValue.h.
References llvm::Value::setName().
|
inline |
Definition at line 75 of file GlobalValue.h.
References llvm::Constant::removeDeadConstantUsers().
Definition at line 290 of file GlobalValue.h.
References llvm::Value::FunctionVal, llvm::Value::getValueID(), llvm::Value::GlobalAliasVal, and llvm::Value::GlobalVariableVal.
|
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().
|
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.
|
pure virtual |
eraseFromParent - This method unlinks 'this' from the containing module and deletes it.
Implemented in llvm::Function, llvm::GlobalVariable, and llvm::GlobalAlias.
|
inline |
Definition at line 79 of file GlobalValue.h.
References Alignment.
Referenced by llvm::ConstantFoldBinaryInstruction(), copyAttributesFrom(), copyGVAttributes(), getGVAlignmentLog2(), llvm::DataLayout::getPreferredAlignment(), llvm::SystemZSubtarget::isPC32DBLSymbol(), llvm::AArch64TargetLowering::LowerGlobalAddressELFSmall(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), setAlignment(), SRAGlobal(), and llvm::ObjectSizeOffsetVisitor::visitGlobalVariable().
|
inline |
Definition at line 218 of file GlobalValue.h.
References Linkage.
Referenced by canBeHidden(), llvm::CloneFunction(), getEncodedLinkage(), INITIALIZE_PASS(), InstallGlobalCtors(), makeVisible(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), and UpgradeIntrinsicFunction1().
|
inlinestatic |
Definition at line 111 of file GlobalValue.h.
References LinkOnceAnyLinkage, and LinkOnceODRLinkage.
|
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().
|
inline |
Definition at line 287 of file GlobalValue.h.
References Parent.
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().
|
inline |
Definition at line 96 of file GlobalValue.h.
References Section.
Referenced by copyAttributesFrom(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), isSuitableForBSS(), llvm::AssemblyWriter::printFunction(), and llvm::AssemblyWriter::printGlobal().
|
inline |
getType - Global values are always pointers.
Definition at line 107 of file GlobalValue.h.
References llvm::Value::getType().
Referenced by llvm::Interpreter::callExternalFunction(), canDemoteGlobalVar(), llvm::BlockAddress::destroyConstant(), llvm::ExecutionEngine::emitGlobals(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::GlobalAddressSDNode::getAddressSpace(), llvm::Function::getContext(), llvm::Function::getFunctionType(), llvm::SelectionDAG::getGlobalAddress(), llvm::GetGlobalTypeString(), llvm::JIT::getMemoryForGV(), llvm::Module::getOrInsertFunction(), llvm::Module::getOrInsertGlobal(), llvm::DataLayout::getPreferredAlignment(), llvm::SelectionDAG::InferPtrAlignment(), INITIALIZE_PASS(), InstallGlobalCtors(), IsConstantOffsetFromGlobal(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::SpecialCaseList::isIn(), isLeakCheckerRoot(), OptimizeGlobalAddressOfMalloc(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printGlobal(), llvm::GlobalAlias::setAliasee(), llvm::GlobalVariable::setInitializer(), SRAGlobal(), TryToShrinkGlobalToBoolean(), and llvm::ObjectSizeOffsetVisitor::visitGlobalVariable().
|
inline |
Definition at line 87 of file GlobalValue.h.
References Visibility.
Referenced by copyAttributesFrom(), llvm::AsmPrinter::doFinalization(), llvm::AsmPrinter::EmitFunctionHeader(), llvm::AsmPrinter::EmitGlobalVariable(), getEncodedVisibility(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), and llvm::AssemblyWriter::printGlobal().
|
inlinestatic |
Definition at line 114 of file GlobalValue.h.
References WeakAnyLinkage, and WeakODRLinkage.
|
inline |
Definition at line 204 of file GlobalValue.h.
References isAppendingLinkage(), and Linkage.
Referenced by llvm::ExecutionEngine::emitGlobals(), and llvm::AsmPrinter::EmitSpecialLLVMGlobal().
|
inline |
Definition at line 195 of file GlobalValue.h.
References isAvailableExternallyLinkage(), and Linkage.
Referenced by llvm::X86Subtarget::ClassifyGlobalReference(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::JIT::getOrEmitGlobalVariable(), llvm::JIT::getPointerToFunction(), llvm::MCJIT::getPointerToFunction(), llvm::ARMSubtarget::GVIsIndirectSymbol(), isDeclaration(), llvm::Function::isDefTriviallyDead(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), and shouldInternalize().
|
inline |
Definition at line 215 of file GlobalValue.h.
References isCommonLinkage(), and Linkage.
Referenced by llvm::X86Subtarget::ClassifyGlobalReference(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::ARMSubtarget::GVIsIndirectSymbol(), and llvm::PPCSubtarget::hasLazyResolverStub().
|
inline |
Definition at line 88 of file GlobalValue.h.
References DefaultVisibility, and Visibility.
Referenced by bindsLocally(), and llvm::X86Subtarget::ClassifyGlobalReference().
|
inline |
Definition at line 213 of file GlobalValue.h.
References isDLLExportLinkage(), and Linkage.
Referenced by llvm::ExecutionEngine::emitGlobals().
|
inline |
Definition at line 212 of file GlobalValue.h.
References isDLLImportLinkage(), and Linkage.
Referenced by llvm::X86Subtarget::ClassifyGlobalReference(), and llvm::ExecutionEngine::emitGlobals().
|
inline |
Definition at line 194 of file GlobalValue.h.
References isExternalLinkage(), and Linkage.
Referenced by llvm::ExecutionEngine::emitGlobals(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::AssemblyWriter::printGlobal(), and llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal().
|
inline |
Definition at line 214 of file GlobalValue.h.
References isExternalWeakLinkage(), and Linkage.
Referenced by llvm::ExecutionEngine::emitGlobals(), llvm::JIT::getPointerToFunction(), and llvm::MCJIT::getPointerToFunction().
|
inline |
Definition at line 89 of file GlobalValue.h.
References HiddenVisibility, and Visibility.
Referenced by llvm::X86Subtarget::ClassifyGlobalReference(), llvm::TargetMachine::getTLSModel(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::AArch64Subtarget::GVIsIndirectSymbol(), llvm::ARMSubtarget::GVIsIndirectSymbol(), and llvm::PPCSubtarget::hasLazyResolverStub().
|
inline |
Definition at line 205 of file GlobalValue.h.
References isInternalLinkage(), and Linkage.
Referenced by canDemoteGlobalVar(), GetSymbolFromOperand(), llvm::X86AsmPrinter::printSymbolOperand(), and llvm::X86AsmPrinter::runOnMachineFunction().
|
inline |
Definition at line 207 of file GlobalValue.h.
References isLinkerPrivateLinkage(), and Linkage.
Referenced by llvm::Mangler::getNameWithPrefix().
|
inline |
Definition at line 208 of file GlobalValue.h.
References isLinkerPrivateWeakLinkage(), and Linkage.
Referenced by llvm::Mangler::getNameWithPrefix().
|
inline |
Definition at line 198 of file GlobalValue.h.
References isLinkOnceLinkage(), and Linkage.
Referenced by llvm::PPCSubtarget::hasLazyResolverStub(), llvm::Function::isDefTriviallyDead(), and makeVisible().
|
inline |
Definition at line 211 of file GlobalValue.h.
References isLocalLinkage(), and Linkage.
Referenced by bindsLocally(), llvm::X86Subtarget::ClassifyGlobalReference(), llvm::ExecutionEngine::emitGlobals(), forceRenaming(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), getIntrinsicIDForCall(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::Module::getOrInsertFunction(), llvm::TargetMachine::getTLSModel(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::AArch64Subtarget::GVIsIndirectSymbol(), llvm::ARMSubtarget::GVIsIndirectSymbol(), hasUsesToReplace(), IsBetterCannonical(), llvm::Function::isDefTriviallyDead(), makeVisible(), mayHaveOtherReferences(), llvm::Inliner::runOnSCC(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), llvm::FastISel::SelectInstruction(), llvm::TargetLoweringObjectFileMachO::shouldEmitUsedDirectiveFor(), shouldInternalize(), and SRAGlobal().
|
inline |
Definition at line 206 of file GlobalValue.h.
References isPrivateLinkage(), and Linkage.
Referenced by llvm::Mangler::getNameWithPrefix(), and isLeakCheckerRoot().
|
inline |
Definition at line 90 of file GlobalValue.h.
References ProtectedVisibility, and Visibility.
|
inline |
Definition at line 95 of file GlobalValue.h.
References Section.
Referenced by getGVAlignmentLog2(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), and llvm::TargetLoweringObjectFile::SectionForGlobal().
|
inline |
Definition at line 84 of file GlobalValue.h.
References UnnamedAddr.
Referenced by canBeHidden(), copyAttributesFrom(), llvm::TargetLoweringObjectFile::getKindForGlobal(), IsBetterCannonical(), llvm::AssemblyWriter::printFunction(), and llvm::AssemblyWriter::printGlobal().
|
inline |
Definition at line 201 of file GlobalValue.h.
References isWeakLinkage(), and Linkage.
Referenced by llvm::PPCSubtarget::hasLazyResolverStub().
|
inlinestatic |
Definition at line 130 of file GlobalValue.h.
References AppendingLinkage.
Referenced by hasAppendingLinkage().
|
inlinestatic |
Definition at line 121 of file GlobalValue.h.
References AvailableExternallyLinkage.
Referenced by hasAvailableExternallyLinkage().
|
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().
|
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().
|
inline |
Definition at line 220 of file GlobalValue.h.
References Linkage.
|
inlinestatic |
Definition at line 152 of file GlobalValue.h.
References DLLExportLinkage.
Referenced by hasDLLExportLinkage().
|
inlinestatic |
Definition at line 149 of file GlobalValue.h.
References DLLImportLinkage.
Referenced by hasDLLImportLinkage().
|
inlinestatic |
Definition at line 118 of file GlobalValue.h.
References ExternalLinkage.
Referenced by hasExternalLinkage(), and llvm::GlobalAlias::isValidLinkage().
|
inlinestatic |
Definition at line 155 of file GlobalValue.h.
References ExternalWeakLinkage.
Referenced by hasExternalWeakLinkage().
|
inlinestatic |
Definition at line 133 of file GlobalValue.h.
References InternalLinkage.
Referenced by hasInternalLinkage(), and isLocalLinkage().
|
inlinestatic |
Definition at line 139 of file GlobalValue.h.
References LinkerPrivateLinkage.
Referenced by hasLinkerPrivateLinkage(), and isLocalLinkage().
|
inlinestatic |
Definition at line 142 of file GlobalValue.h.
References LinkerPrivateWeakLinkage.
Referenced by hasLinkerPrivateWeakLinkage(), and isLocalLinkage().
|
inlinestatic |
Definition at line 124 of file GlobalValue.h.
References LinkOnceAnyLinkage, and LinkOnceODRLinkage.
Referenced by hasLinkOnceLinkage(), isDiscardableIfUnused(), and llvm::GlobalAlias::isValidLinkage().
|
inlinestatic |
Definition at line 145 of file GlobalValue.h.
References isInternalLinkage(), isLinkerPrivateLinkage(), isLinkerPrivateWeakLinkage(), and isPrivateLinkage().
Referenced by hasLocalLinkage(), isDiscardableIfUnused(), and llvm::GlobalAlias::isValidLinkage().
bool GlobalValue::isMaterializable | ( | ) | const |
isMaterializable - 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.
Definition at line 30 of file Globals.cpp.
References getParent(), and llvm::Module::isMaterializable().
Referenced by llvm::X86Subtarget::ClassifyGlobalReference(), llvm::ARMSubtarget::GVIsIndirectSymbol(), llvm::PPCSubtarget::hasLazyResolverStub(), isDeclaration(), isNonGhostDeclaration(), llvm::BitcodeReader::Materialize(), llvm::BitcodeReader::MaterializeModule(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), and llvm::legacy::FunctionPassManager::run().
|
inlinestatic |
Definition at line 136 of file GlobalValue.h.
References PrivateLinkage.
Referenced by hasPrivateLinkage(), and isLocalLinkage().
|
inlinestatic |
isWeakForLinker - 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 183 of file GlobalValue.h.
References AvailableExternallyLinkage, CommonLinkage, ExternalWeakLinkage, LinkerPrivateWeakLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage, WeakAnyLinkage, and WeakODRLinkage.
Referenced by llvm::X86Subtarget::ClassifyGlobalReference(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::ARMSubtarget::GVIsIndirectSymbol(), llvm::TargetLowering::isOffsetFoldingLegal(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
|
inline |
Definition at line 226 of file GlobalValue.h.
References isWeakForLinker(), and Linkage.
Referenced by llvm::GlobalVariable::hasUniqueInitializer(), and isWeakForLinker().
|
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().
|
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().
|
inline |
Definition at line 224 of file GlobalValue.h.
References Linkage, and mayBeOverridden().
Referenced by llvm::GlobalVariable::hasDefinitiveInitializer(), mayBeOverridden(), and llvm::GlobalAlias::resolveAliasedGlobal().
|
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().
|
inline |
Definition at line 217 of file GlobalValue.h.
References Linkage, and llvm::A64CC::LT.
Referenced by llvm::Function::deleteBody(), LLVMSetLinkage(), and makeVisible().
|
inline |
Definition at line 97 of file GlobalValue.h.
References Section.
Referenced by assureFPCallStub(), copyAttributesFrom(), createFPFnStub(), and setUsedInitializer().
|
inline |
Definition at line 85 of file GlobalValue.h.
References UnnamedAddr.
Referenced by copyAttributesFrom(), llvm::IRBuilderBase::CreateGlobalString(), and createPrivateGlobalForString().
|
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.
|
protected |
Definition at line 70 of file GlobalValue.h.
Referenced by getAlignment(), and setAlignment().
|
protected |
Definition at line 68 of file GlobalValue.h.
Referenced by getLinkage(), hasAppendingLinkage(), hasAvailableExternallyLinkage(), hasCommonLinkage(), hasDLLExportLinkage(), hasDLLImportLinkage(), hasExternalLinkage(), hasExternalWeakLinkage(), hasInternalLinkage(), hasLinkerPrivateLinkage(), hasLinkerPrivateWeakLinkage(), hasLinkOnceLinkage(), hasLocalLinkage(), hasPrivateLinkage(), hasWeakLinkage(), isDiscardableIfUnused(), isWeakForLinker(), mayBeOverridden(), and setLinkage().
|
protected |
Definition at line 72 of file GlobalValue.h.
Referenced by getParent().
|
protected |
Definition at line 73 of file GlobalValue.h.
Referenced by getSection(), hasSection(), and setSection().
|
protected |
Definition at line 71 of file GlobalValue.h.
Referenced by hasUnnamedAddr(), and setUnnamedAddr().
|
protected |
Definition at line 69 of file GlobalValue.h.
Referenced by getVisibility(), hasDefaultVisibility(), hasHiddenVisibility(), hasProtectedVisibility(), and setVisibility().