LLVM API Documentation
#include <GlobalValue.h>
Definition at line 30 of file GlobalValue.h.
Storage classes of global values for PE targets.
DefaultStorageClass | |
DLLImportStorageClass |
Function to be imported from DLL. |
DLLExportStorageClass |
Function to be accessible from DLL. |
Definition at line 56 of file GlobalValue.h.
An enumeration for the kinds of linkage for global values.
Definition at line 34 of file GlobalValue.h.
NotThreadLocal | |
GeneralDynamicTLSModel | |
LocalDynamicTLSModel | |
InitialExecTLSModel | |
LocalExecTLSModel |
Definition at line 97 of file GlobalValue.h.
An enumeration for the kinds of visibility of global values.
DefaultVisibility |
The GV is visible. |
HiddenVisibility |
The GV is hidden. |
ProtectedVisibility |
The GV is protected. |
Definition at line 49 of file GlobalValue.h.
llvm::GlobalValue::GlobalValue | ( | Type * | Ty, |
ValueTy | VTy, | ||
Use * | Ops, | ||
unsigned | NumOps, | ||
LinkageTypes | Linkage, | ||
const Twine & | Name | ||
) | [inline, protected] |
Definition at line 63 of file GlobalValue.h.
References llvm::Value::setName().
llvm::GlobalValue::~GlobalValue | ( | ) | [inline] |
Definition at line 105 of file GlobalValue.h.
References llvm::Constant::removeDeadConstantUsers().
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 343 of file GlobalValue.h.
References llvm::Value::FunctionVal, llvm::Value::getValueID(), llvm::Value::GlobalAliasVal, and llvm::Value::GlobalVariableVal.
void GlobalValue::copyAttributesFrom | ( | const GlobalValue * | Src | ) | [virtual] |
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 56 of file Globals.cpp.
References getDLLStorageClass(), getVisibility(), hasUnnamedAddr(), setDLLStorageClass(), setUnnamedAddr(), and setVisibility().
Referenced by llvm::CloneModule(), and copyGVAttributes().
void GlobalValue::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 40 of file Globals.cpp.
References llvm::Module::Dematerialize(), and getParent().
void GlobalValue::destroyConstant | ( | ) | [override, 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 50 of file Globals.cpp.
References llvm_unreachable.
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.
unsigned GlobalValue::getAlignment | ( | ) | const |
Reimplemented in llvm::GlobalObject.
Definition at line 62 of file Globals.cpp.
Referenced by llvm::ConstantFoldBinaryInstruction(), copyGVAttributes(), getGVAlignmentLog2(), and llvm::SystemZSubtarget::isPC32DBLSymbol().
Comdat * GlobalValue::getComdat | ( | ) |
Reimplemented in llvm::GlobalObject.
Definition at line 101 of file Globals.cpp.
Referenced by checkMachOComdat(), getComdat(), getComdatGVForCOFF(), getELFComdat(), getSelectionForCOFF(), and hasComdat().
const Comdat* llvm::GlobalValue::getComdat | ( | ) | const [inline] |
Reimplemented in llvm::GlobalObject.
Definition at line 116 of file GlobalValue.h.
References getComdat().
const DataLayout * GlobalValue::getDataLayout | ( | ) | const |
Definition at line 44 of file Globals.cpp.
References llvm::Module::getDataLayout(), and getParent().
Referenced by llvm::BasicBlock::getDataLayout(), and llvm::InlineCostAnalysis::getInlineCost().
DLLStorageClassTypes llvm::GlobalValue::getDLLStorageClass | ( | ) | const [inline] |
Definition at line 145 of file GlobalValue.h.
References DllStorageClass.
Referenced by copyAttributesFrom(), getEncodedDLLStorageClass(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), and llvm::AssemblyWriter::printGlobal().
unsigned llvm::GlobalValue::getGlobalValueSubClassData | ( | ) | const [inline, protected] |
Definition at line 87 of file GlobalValue.h.
Referenced by llvm::GlobalObject::getAlignment().
LinkageTypes llvm::GlobalValue::getLinkage | ( | ) | const [inline] |
Definition at line 271 of file GlobalValue.h.
References Linkage.
Referenced by llvm::CloneFunction(), llvm::GlobalAlias::create(), getEncodedLinkage(), INITIALIZE_PASS(), INITIALIZE_TM_PASS(), makeVisible(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), upgradeGlobalArray(), and UpgradeIntrinsicFunction1().
static LinkageTypes llvm::GlobalValue::getLinkOnceLinkage | ( | bool | ODR | ) | [inline, static] |
Definition at line 170 of file GlobalValue.h.
References LinkOnceAnyLinkage, and LinkOnceODRLinkage.
Module* llvm::GlobalValue::getParent | ( | ) | [inline] |
Get the module that this global value is contained inside of...
Definition at line 337 of file GlobalValue.h.
References Parent.
Referenced by changeToUnreachable(), CloneDebugInfoMetadata(), llvm::GlobalAlias::create(), llvm::IRBuilderBase::CreateGlobalString(), llvm::IRBuilderBase::CreateLifetimeEnd(), llvm::IRBuilderBase::CreateLifetimeStart(), llvm::IRBuilderBase::CreateMemCpy(), llvm::IRBuilderBase::CreateMemMove(), llvm::IRBuilderBase::CreateMemSet(), Dematerialize(), llvm::EmitBinaryFloatFnCall(), llvm::EmitFPutC(), llvm::EmitFPutS(), llvm::AsmPrinter::EmitFunctionHeader(), llvm::EmitFWrite(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::AArch64TargetLowering::emitLoadLinked(), llvm::ARMTargetLowering::emitLoadLinked(), llvm::EmitMemChr(), llvm::EmitMemCmp(), llvm::EmitMemCpyChk(), llvm::EmitPutChar(), llvm::EmitPutS(), llvm::AArch64TargetLowering::emitStoreConditional(), llvm::ARMTargetLowering::emitStoreConditional(), 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(), generateUnsignedDivisionCode(), llvm::CallSiteBase< Function, Value, User, Instruction, CallInst, InvokeInst, User::op_iterator >::getCaller(), getComdatGVForCOFF(), getDataLayout(), llvm::RegionBase< Tr >::getDepth(), llvm::GCModuleInfo::getFunctionInfo(), llvm::Trace::getModule(), getModuleFromVal(), llvm::CallGraph::getOrInsertFunction(), getParent(), llvm::MCJIT::getPointerToFunction(), llvm::SparcTargetLowering::getSRetArgSize(), llvm::GlobalVariable::GlobalVariable(), hasDebugInfo(), hasReturnsTwiceAttr(), INITIALIZE_PASS(), llvm::InlineFunction(), insertSinCosCall(), isDematerializable(), llvm::isImageReadOnly(), llvm::isImageReadWrite(), llvm::isImageWriteOnly(), isMaterializable(), llvm::isSampler(), llvm::lintFunction(), LLVMGetNextFunction(), LLVMGetNextGlobal(), LLVMGetPreviousFunction(), LLVMGetPreviousGlobal(), nvptx::LowerConstant(), lowerConstant(), llvm::LowerDbgDeclare(), llvm::IntrinsicLowering::LowerToByteSwap(), makeDMB(), Materialize(), OptimizeGlobalAddressOfMalloc(), parentFunctionOfValue(), PerformHeapAllocSRoA(), llvm::Value::print(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), PrintOps(), ProcessUAddIdiom(), ProcessUGT_ADDCST_ADD(), ProcessUMulZExtIdiom(), promoteSingleBlockAlloca(), llvm::GlobalAlias::removeFromParent(), llvm::GlobalVariable::removeFromParent(), llvm::Function::removeFromParent(), ReplaceCallWith(), rewriteSingleStoreAlloca(), llvm::NVPTXLowerAggrCopies::runOnFunction(), llvm::StackProtector::runOnFunction(), setUsedInitializer(), SRAGlobal(), SwitchToLookupTable(), TryToShrinkGlobalToBoolean(), upgradeGlobalArray(), llvm::UpgradeIntrinsicCall(), UpgradeIntrinsicFunction1(), UpgradeSSE41Function(), UpgradeX86IntrinsicsWith8BitMask(), usedInOneFunc(), llvm::InstCombiner::visitCallInst(), and llvm::InstCombiner::visitFPTrunc().
const Module* llvm::GlobalValue::getParent | ( | ) | const [inline] |
Definition at line 338 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 288 of file GlobalValue.h.
References llvm::StringRef::empty(), and llvm::StringRef::substr().
Referenced by llvm::DwarfUnit::applySubprogramAttributes(), llvm::DwarfCompileUnit::createGlobalVariableDIE(), and fixupSubprogramName().
const char * GlobalValue::getSection | ( | ) | const |
Reimplemented in llvm::GlobalObject.
Definition at line 91 of file Globals.cpp.
Referenced by llvm::XCoreTargetObjectFile::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileELF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileMachO::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), and hasSection().
ThreadLocalMode llvm::GlobalValue::getThreadLocalMode | ( | ) | const [inline] |
Definition at line 141 of file GlobalValue.h.
References ThreadLocal.
Referenced by llvm::GlobalVariable::copyAttributesFrom(), getEncodedThreadLocalMode(), getSelectedTLSModel(), INITIALIZE_PASS(), isThreadLocal(), OptimizeGlobalAddressOfMalloc(), PerformHeapAllocSRoA(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printGlobal(), SRAGlobal(), TryToShrinkGlobalToBoolean(), and upgradeGlobalArray().
PointerType* llvm::GlobalValue::getType | ( | ) | const [inline] |
Global values are always pointers.
Reimplemented from llvm::Value.
Definition at line 166 of file GlobalValue.h.
Referenced by llvm::Interpreter::callExternalFunction(), canDemoteGlobalVar(), llvm::GlobalAlias::create(), 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::Module::getOrInsertFunction(), llvm::Module::getOrInsertGlobal(), llvm::DataLayout::getPreferredAlignment(), llvm::SelectionDAG::InferPtrAlignment(), INITIALIZE_PASS(), INITIALIZE_TM_PASS(), IsConstantOffsetFromGlobal(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), isLeakCheckerRoot(), IsSmallObject(), OptimizeGlobalAddressOfMalloc(), PerformHeapAllocSRoA(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printGlobal(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), llvm::GlobalAlias::setAliasee(), llvm::GlobalVariable::setInitializer(), SRAGlobal(), TryToShrinkGlobalToBoolean(), upgradeGlobalArray(), and llvm::ObjectSizeOffsetVisitor::visitGlobalVariable().
VisibilityTypes llvm::GlobalValue::getVisibility | ( | ) | const [inline] |
Definition at line 120 of file GlobalValue.h.
References Visibility.
Referenced by copyAttributesFrom(), llvm::AsmPrinter::EmitFunctionHeader(), llvm::AsmPrinter::EmitGlobalVariable(), getEncodedVisibility(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), and llvm::AssemblyWriter::printGlobal().
static LinkageTypes llvm::GlobalValue::getWeakLinkage | ( | bool | ODR | ) | [inline, static] |
Definition at line 173 of file GlobalValue.h.
References WeakAnyLinkage, and WeakODRLinkage.
bool llvm::GlobalValue::hasAppendingLinkage | ( | ) | const [inline] |
Definition at line 259 of file GlobalValue.h.
References isAppendingLinkage(), and Linkage.
Referenced by llvm::ExecutionEngine::emitGlobals(), and llvm::AsmPrinter::EmitSpecialLLVMGlobal().
bool llvm::GlobalValue::hasAvailableExternallyLinkage | ( | ) | const [inline] |
Definition at line 243 of file GlobalValue.h.
References isAvailableExternallyLinkage(), and Linkage.
Referenced by llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::MCJIT::getPointerToFunction(), llvm::ARMSubtarget::GVIsIndirectSymbol(), isDeclaration(), llvm::Function::isDefTriviallyDead(), llvm::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), and shouldInternalize().
bool llvm::GlobalValue::hasComdat | ( | ) | const [inline] |
Reimplemented in llvm::GlobalObject.
Definition at line 114 of file GlobalValue.h.
References getComdat().
Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
bool llvm::GlobalValue::hasCommonLinkage | ( | ) | const [inline] |
Definition at line 264 of file GlobalValue.h.
References isCommonLinkage(), and Linkage.
Referenced by llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::object::IRObjectFile::getSymbolFlags(), llvm::ARMSubtarget::GVIsIndirectSymbol(), and llvm::PPCSubtarget::hasLazyResolverStub().
bool llvm::GlobalValue::hasDefaultVisibility | ( | ) | const [inline] |
Definition at line 121 of file GlobalValue.h.
References DefaultVisibility, and Visibility.
Referenced by bindsLocally(), and llvm::AArch64Subtarget::ClassifyGlobalReference().
bool llvm::GlobalValue::hasDLLExportStorageClass | ( | ) | const [inline] |
Definition at line 151 of file GlobalValue.h.
References DLLExportStorageClass, and DllStorageClass.
Referenced by llvm::X86AsmPrinter::EmitEndOfAsmFile(), and shouldInternalize().
bool llvm::GlobalValue::hasDLLImportStorageClass | ( | ) | const [inline] |
Definition at line 148 of file GlobalValue.h.
References DLLImportStorageClass, and DllStorageClass.
Referenced by isSimpleEnoughValueToCommitHelper().
bool llvm::GlobalValue::hasExternalLinkage | ( | ) | const [inline] |
Definition at line 242 of file GlobalValue.h.
References isExternalLinkage(), and Linkage.
Referenced by llvm::ExecutionEngine::emitGlobals(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::AssemblyWriter::printGlobal(), and llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal().
bool llvm::GlobalValue::hasExternalWeakLinkage | ( | ) | const [inline] |
Definition at line 263 of file GlobalValue.h.
References isExternalWeakLinkage(), and Linkage.
Referenced by areGlobalsPotentiallyEqual(), llvm::ExecutionEngine::emitGlobals(), and llvm::MCJIT::getPointerToFunction().
bool llvm::GlobalValue::hasHiddenVisibility | ( | ) | const [inline] |
Definition at line 122 of file GlobalValue.h.
References HiddenVisibility, and Visibility.
Referenced by llvm::TargetMachine::getTLSModel(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::ARMSubtarget::GVIsIndirectSymbol(), and llvm::PPCSubtarget::hasLazyResolverStub().
bool llvm::GlobalValue::hasInternalLinkage | ( | ) | const [inline] |
Definition at line 260 of file GlobalValue.h.
References isInternalLinkage(), and Linkage.
Referenced by canDemoteGlobalVar(), GetSymbolFromOperand(), printSymbolOperand(), llvm::ARMAsmPrinter::runOnMachineFunction(), and llvm::X86AsmPrinter::runOnMachineFunction().
bool llvm::GlobalValue::hasLinkOnceLinkage | ( | ) | const [inline] |
Definition at line 246 of file GlobalValue.h.
References isLinkOnceLinkage(), and Linkage.
Referenced by llvm::object::IRObjectFile::getSymbolFlags(), llvm::PPCSubtarget::hasLazyResolverStub(), llvm::Function::isDefTriviallyDead(), and makeVisible().
bool llvm::GlobalValue::hasLinkOnceODRLinkage | ( | ) | const [inline] |
Definition at line 249 of file GlobalValue.h.
References isLinkOnceODRLinkage(), and Linkage.
Referenced by llvm::canBeOmittedFromSymbolTable().
bool llvm::GlobalValue::hasLocalLinkage | ( | ) | const [inline] |
Definition at line 262 of file GlobalValue.h.
References isLocalLinkage(), and Linkage.
Referenced by bindsLocally(), llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::ExecutionEngine::emitGlobals(), forceRenaming(), llvm::TargetLoweringObjectFileMachO::getCFIPersonalitySymbol(), llvm::getIntrinsicIDForCall(), llvm::TargetLoweringObjectFile::getKindForGlobal(), llvm::object::IRObjectFile::getSymbolFlags(), llvm::TargetMachine::getTLSModel(), llvm::SparcELFTargetObjectFile::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileELF::getTTypeGlobalReference(), llvm::TargetLoweringObjectFileMachO::getTTypeGlobalReference(), llvm::ARMSubtarget::GVIsIndirectSymbol(), hasUsesToReplace(), IsBetterCanonical(), llvm::Function::isDefTriviallyDead(), makeVisible(), mayHaveOtherReferences(), llvm::Inliner::runOnSCC(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), llvm::FastISel::selectInstruction(), setVisibility(), shouldInternalize(), and SRAGlobal().
bool llvm::GlobalValue::hasPrivateLinkage | ( | ) | const [inline] |
Definition at line 261 of file GlobalValue.h.
References isPrivateLinkage(), and Linkage.
Referenced by llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), llvm::Mangler::getNameWithPrefix(), llvm::TargetMachine::getNameWithPrefix(), llvm::object::IRObjectFile::getSymbolFlags(), isLeakCheckerRoot(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
bool llvm::GlobalValue::hasProtectedVisibility | ( | ) | const [inline] |
Definition at line 123 of file GlobalValue.h.
References ProtectedVisibility, and Visibility.
bool llvm::GlobalValue::hasSection | ( | ) | const [inline] |
Reimplemented in llvm::GlobalObject.
Definition at line 156 of file GlobalValue.h.
References llvm::StringRef::empty(), and getSection().
Referenced by getGVAlignmentLog2(), and llvm::TargetLoweringObjectFile::SectionForGlobal().
bool llvm::GlobalValue::hasUnnamedAddr | ( | ) | const [inline] |
Definition at line 111 of file GlobalValue.h.
References UnnamedAddr.
Referenced by llvm::canBeOmittedFromSymbolTable(), copyAttributesFrom(), llvm::TargetLoweringObjectFile::getKindForGlobal(), IsBetterCanonical(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), and llvm::JumpInstrTables::runOnModule().
bool llvm::GlobalValue::hasWeakAnyLinkage | ( | ) | const [inline] |
Definition at line 253 of file GlobalValue.h.
References isWeakAnyLinkage(), and Linkage.
bool llvm::GlobalValue::hasWeakLinkage | ( | ) | const [inline] |
Definition at line 250 of file GlobalValue.h.
References isWeakLinkage(), and Linkage.
Referenced by llvm::object::IRObjectFile::getSymbolFlags(), and llvm::PPCSubtarget::hasLazyResolverStub().
bool llvm::GlobalValue::hasWeakODRLinkage | ( | ) | const [inline] |
Definition at line 256 of file GlobalValue.h.
References isWeakODRLinkage(), and Linkage.
static bool llvm::GlobalValue::isAppendingLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 198 of file GlobalValue.h.
References AppendingLinkage.
Referenced by hasAppendingLinkage().
static bool llvm::GlobalValue::isAvailableExternallyLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 180 of file GlobalValue.h.
References AvailableExternallyLinkage.
Referenced by hasAvailableExternallyLinkage().
static bool llvm::GlobalValue::isCommonLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 213 of file GlobalValue.h.
References CommonLinkage.
Referenced by hasCommonLinkage().
bool GlobalValue::isDeclaration | ( | ) | const |
Return true if the primary definition of this global value is outside of the current translation unit.
Definition at line 113 of file Globals.cpp.
References F().
Referenced by assureFPCallStub(), llvm::Interpreter::callFunction(), llvm::AArch64Subtarget::ClassifyGlobalReference(), cxxDtorIsEmpty(), llvm::ExecutionEngine::emitGlobals(), llvm::AsmPrinter::EmitGlobalVariable(), llvm::MCJIT::findModuleForSymbol(), getCalledFunction(), llvm::GCModuleInfo::getFunctionInfo(), llvm::Inliner::getInlineThreshold(), llvm::TargetLoweringObjectFile::getKindForGlobal(), 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::MipsTargetObjectFile::IsGlobalInSmallSection(), llvm::HexagonTargetObjectFile::IsGlobalInSmallSection(), llvm::BitcodeReader::isMaterializable(), llvm::TargetLowering::isOffsetFoldingLegal(), isReportingError(), llvm::lintFunction(), predictUseListOrder(), 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 |
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 34 of file Globals.cpp.
References getParent(), and llvm::Module::isDematerializable().
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 219 of file GlobalValue.h.
References isLinkOnceLinkage(), and isLocalLinkage().
Referenced by makeVisible().
bool llvm::GlobalValue::isDiscardableIfUnused | ( | ) | const [inline] |
Definition at line 273 of file GlobalValue.h.
References Linkage.
static bool llvm::GlobalValue::isExternalLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 177 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 210 of file GlobalValue.h.
References ExternalWeakLinkage.
Referenced by hasExternalWeakLinkage().
static bool llvm::GlobalValue::isInternalLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 201 of file GlobalValue.h.
References InternalLinkage.
Referenced by hasInternalLinkage(), and isLocalLinkage().
static bool llvm::GlobalValue::isLinkOnceLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 186 of file GlobalValue.h.
References LinkOnceAnyLinkage, and LinkOnceODRLinkage.
Referenced by hasLinkOnceLinkage(), isDiscardableIfUnused(), and llvm::GlobalAlias::isValidLinkage().
static bool llvm::GlobalValue::isLinkOnceODRLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 183 of file GlobalValue.h.
References LinkOnceODRLinkage.
Referenced by hasLinkOnceODRLinkage().
static bool llvm::GlobalValue::isLocalLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 207 of file GlobalValue.h.
References isInternalLinkage(), and isPrivateLinkage().
Referenced by hasLocalLinkage(), isDiscardableIfUnused(), llvm::GlobalAlias::isValidLinkage(), isValidVisibilityForLinkage(), llvm::XCoreTargetObjectFile::SelectSectionForGlobal(), and setLinkage().
bool GlobalValue::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.
Definition at line 31 of file Globals.cpp.
References getParent(), and llvm::Module::isMaterializable().
Referenced by llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::ARMSubtarget::GVIsIndirectSymbol(), llvm::PPCSubtarget::hasLazyResolverStub(), isDeclaration(), llvm::BitcodeReader::Materialize(), llvm::BitcodeReader::materializeForwardReferencedFunctions(), llvm::BitcodeReader::MaterializeModule(), llvm::AssemblyWriter::printAlias(), llvm::AssemblyWriter::printFunction(), llvm::AssemblyWriter::printGlobal(), and llvm::legacy::FunctionPassManager::run().
static bool llvm::GlobalValue::isPrivateLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 204 of file GlobalValue.h.
References PrivateLinkage.
Referenced by hasPrivateLinkage(), and isLocalLinkage().
bool llvm::GlobalValue::isThreadLocal | ( | ) | const [inline] |
If the value is "Thread Local", its value isn't shared by the threads.
Definition at line 133 of file GlobalValue.h.
References getThreadLocalMode(), and NotThreadLocal.
Referenced by llvm::DwarfCompileUnit::createGlobalVariableDIE(), llvm::ExecutionEngine::EmitGlobalVariable(), llvm::SelectionDAG::getGlobalAddress(), llvm::TargetLoweringObjectFile::getKindForGlobal(), and isSimpleEnoughValueToCommitHelper().
static bool llvm::GlobalValue::isWeakAnyLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 189 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 235 of file GlobalValue.h.
References AvailableExternallyLinkage, CommonLinkage, ExternalWeakLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage, WeakAnyLinkage, and WeakODRLinkage.
Referenced by llvm::AArch64Subtarget::ClassifyGlobalReference(), llvm::AsmPrinter::EmitJumpTableInfo(), llvm::TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(), getSelectionForCOFF(), llvm::ARMSubtarget::GVIsIndirectSymbol(), llvm::TargetLowering::isOffsetFoldingLegal(), llvm::TargetLoweringObjectFileELF::SelectSectionForGlobal(), llvm::TargetLoweringObjectFileMachO::SelectSectionForGlobal(), and llvm::TargetLoweringObjectFileCOFF::SelectSectionForGlobal().
bool llvm::GlobalValue::isWeakForLinker | ( | ) | const [inline] |
Definition at line 279 of file GlobalValue.h.
References isWeakForLinker(), and Linkage.
Referenced by llvm::GlobalVariable::hasUniqueInitializer(), and isWeakForLinker().
static bool llvm::GlobalValue::isWeakLinkage | ( | LinkageTypes | Linkage | ) | [inline, static] |
Definition at line 195 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 192 of file GlobalValue.h.
References WeakODRLinkage.
Referenced by hasWeakODRLinkage(), and isWeakLinkage().
bool GlobalValue::Materialize | ( | std::string * | ErrInfo = nullptr | ) |
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 37 of file Globals.cpp.
References getParent(), and llvm::Module::Materialize().
Referenced by 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 226 of file GlobalValue.h.
References CommonLinkage, ExternalWeakLinkage, LinkOnceAnyLinkage, and WeakAnyLinkage.
Referenced by llvm::InlineCostAnalysis::getInlineCost(), and llvm::ObjectSizeOffsetVisitor::visitGlobalAlias().
bool llvm::GlobalValue::mayBeOverridden | ( | ) | const [inline] |
Definition at line 277 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.
void llvm::GlobalValue::setDLLStorageClass | ( | DLLStorageClassTypes | C | ) | [inline] |
Definition at line 154 of file GlobalValue.h.
References llvm::CallingConv::C, and DllStorageClass.
Referenced by copyAttributesFrom(), and UpgradeDLLImportExportLinkage().
void llvm::GlobalValue::setGlobalValueSubClassData | ( | unsigned | V | ) | [inline, protected] |
Definition at line 90 of file GlobalValue.h.
Referenced by llvm::GlobalObject::GlobalObject(), and llvm::GlobalObject::setAlignment().
void llvm::GlobalValue::setLinkage | ( | LinkageTypes | LT | ) | [inline] |
Definition at line 266 of file GlobalValue.h.
References DefaultVisibility, isLocalLinkage(), Linkage, llvm::AArch64CC::LT, and Visibility.
Referenced by llvm::Function::deleteBody(), LLVMSetLinkage(), and makeVisible().
void llvm::GlobalValue::setThreadLocal | ( | bool | Val | ) | [inline] |
Definition at line 134 of file GlobalValue.h.
References GeneralDynamicTLSModel, NotThreadLocal, and setThreadLocalMode().
void llvm::GlobalValue::setThreadLocalMode | ( | ThreadLocalMode | Val | ) | [inline] |
Definition at line 137 of file GlobalValue.h.
References llvm::Value::FunctionVal, llvm::Value::getValueID(), and NotThreadLocal.
Referenced by llvm::GlobalVariable::copyAttributesFrom(), llvm::GlobalVariable::GlobalVariable(), LLVMSetThreadLocalMode(), and setThreadLocal().
void llvm::GlobalValue::setUnnamedAddr | ( | bool | Val | ) | [inline] |
Definition at line 112 of file GlobalValue.h.
References UnnamedAddr.
Referenced by copyAttributesFrom(), llvm::IRBuilderBase::CreateGlobalString(), createPrivateGlobalForSourceLoc(), and createPrivateGlobalForString().
void llvm::GlobalValue::setVisibility | ( | VisibilityTypes | V | ) | [inline] |
Definition at line 126 of file GlobalValue.h.
References DefaultVisibility, hasLocalLinkage(), and Visibility.
Referenced by copyAttributesFrom(), and makeVisible().
unsigned llvm::GlobalValue::DllStorageClass [protected] |
Definition at line 77 of file GlobalValue.h.
Referenced by getDLLStorageClass(), hasDLLExportStorageClass(), hasDLLImportStorageClass(), and setDLLStorageClass().
LinkageTypes llvm::GlobalValue::Linkage [protected] |
Definition at line 74 of file GlobalValue.h.
Referenced by getLinkage(), hasAppendingLinkage(), hasAvailableExternallyLinkage(), hasCommonLinkage(), hasExternalLinkage(), hasExternalWeakLinkage(), hasInternalLinkage(), hasLinkOnceLinkage(), hasLinkOnceODRLinkage(), hasLocalLinkage(), hasPrivateLinkage(), hasWeakAnyLinkage(), hasWeakLinkage(), hasWeakODRLinkage(), isDiscardableIfUnused(), isWeakForLinker(), mayBeOverridden(), and setLinkage().
Module* llvm::GlobalValue::Parent [protected] |
Definition at line 95 of file GlobalValue.h.
Referenced by getParent().
unsigned llvm::GlobalValue::ThreadLocal [protected] |
Definition at line 79 of file GlobalValue.h.
Referenced by getThreadLocalMode().
unsigned llvm::GlobalValue::UnnamedAddr [protected] |
Definition at line 76 of file GlobalValue.h.
Referenced by hasUnnamedAddr(), and setUnnamedAddr().
unsigned llvm::GlobalValue::Visibility [protected] |
Definition at line 75 of file GlobalValue.h.
Referenced by getVisibility(), hasDefaultVisibility(), hasHiddenVisibility(), hasProtectedVisibility(), setLinkage(), and setVisibility().