LLVM API Documentation

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

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, LinkOnceLinkage, WeakLinkage, AppendingLinkage,
  InternalLinkage, DLLImportLinkage, DLLExportLinkage, ExternalWeakLinkage,
  GhostLinkage, 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 Member Functions

 ~GlobalValue ()
unsigned getAlignment () const
void setAlignment (unsigned Align)
VisibilityTypes getVisibility () const
bool hasHiddenVisibility () const
bool hasProtectedVisibility () const
void setVisibility (VisibilityTypes V)
bool hasSection () const
const std::string & getSection () const
void setSection (const std::string &S)
bool use_empty_except_constants ()
 Determine if the usage of this global value is empty except for transitively dead constants.
const PointerTypegetType () const
 getType - Global values are always pointers.
bool hasExternalLinkage () const
bool hasLinkOnceLinkage () const
bool hasWeakLinkage () const
bool hasCommonLinkage () const
bool hasAppendingLinkage () const
bool hasInternalLinkage () const
bool hasDLLImportLinkage () const
bool hasDLLExportLinkage () const
bool hasExternalWeakLinkage () const
bool hasGhostLinkage () const
void setLinkage (LinkageTypes LT)
LinkageTypes getLinkage () const
bool isWeakForLinker () const
virtual void copyAttributesFrom (const GlobalValue *Src)
bool hasNotBeenReadFromBitcode () const
virtual bool isNullValue () const
virtual void destroyConstant ()
 Override from Constant class.
virtual bool isDeclaration () const =0
ModulegetParent ()
const ModulegetParent () const
void removeDeadConstantUsers ()

Static Public Member Functions

bool classof (const GlobalValue *)
bool classof (const Value *V)

Protected Member Functions

 GlobalValue (const Type *ty, ValueTy vty, Use *Ops, unsigned NumOps, LinkageTypes linkage, const std::string &name="")

Protected Attributes

ModuleParent
LinkageTypes Linkage: 5
unsigned Visibility: 2
unsigned Alignment: 16
std::string Section

Member Enumeration Documentation

enum llvm::GlobalValue::LinkageTypes
 

An enumeration for the kinds of linkage for global values.

Enumeration values:
ExternalLinkage  Externally visible function.
LinkOnceLinkage  Keep one copy of function when linking (inline).
WeakLinkage  Keep one copy of named function when linking (weak).
AppendingLinkage  Special purpose, only applies to global arrays.
InternalLinkage  Rename collisions when linking (static functions).
DLLImportLinkage  Function to be imported from DLL.
DLLExportLinkage  Function to be accessible from DLL.
ExternalWeakLinkage  ExternalWeak linkage description.
GhostLinkage  Stand-in functions for streaming fns from BC files.
CommonLinkage  Tentative definitions.

Definition at line 32 of file GlobalValue.h.

enum llvm::GlobalValue::VisibilityTypes
 

An enumeration for the kinds of visibility of global values.

Enumeration values:
DefaultVisibility  The GV is visible.
HiddenVisibility  The GV is hidden.
ProtectedVisibility  The GV is protected.

Definition at line 46 of file GlobalValue.h.


Constructor & Destructor Documentation

llvm::GlobalValue::GlobalValue const Type ty,
ValueTy  vty,
Use Ops,
unsigned  NumOps,
LinkageTypes  linkage,
const std::string &  name = ""
[inline, protected]
 

Definition at line 53 of file GlobalValue.h.

llvm::GlobalValue::~GlobalValue  )  [inline]
 

Definition at line 68 of file GlobalValue.h.


Member Function Documentation

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

Reimplemented from llvm::Constant.

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

Definition at line 158 of file GlobalValue.h.

References llvm::Value::getValueID().

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

Reimplemented from llvm::Constant.

Definition at line 157 of file GlobalValue.h.

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 85 of file Globals.cpp.

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

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

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 78 of file Globals.cpp.

unsigned llvm::GlobalValue::getAlignment  )  const [inline]
 

Definition at line 72 of file GlobalValue.h.

Referenced by AlignedLoad(), llvm::ComputeMaskedBits(), llvm::ConstantFoldBinaryInstruction(), copyAttributesFrom(), CopyGVAttributes(), llvm::AsmPrinter::EmitAlignment(), llvm::TargetData::getPreferredAlignment(), isBaseAlignmentOfN(), LinkAppendingVars(), LinkGlobals(), SPUDAGToDAGISel::SelectAFormAddr(), SRAGlobal(), llvm::MachOCodeEmitter::startFunction(), and JITEmitter::startFunction().

LinkageTypes llvm::GlobalValue::getLinkage  )  const [inline]
 

Definition at line 112 of file GlobalValue.h.

Referenced by llvm::CloneFunction(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), llvm::ELFCodeEmitter::finishFunction(), getEncodedLinkage(), GetLinkageResult(), LinuxAsmPrinter::getSectionForFunction(), InstallGlobalCtors(), LinkAlias(), LinkAppendingVars(), LinkFunctionProtos(), LinkGlobals(), llvm::MachOSym::MachOSym(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), SparcAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), MipsAsmPrinter::printModuleLevelGV(), IA64AsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), AlphaAsmPrinter::printModuleLevelGV(), llvm::X86IntelAsmPrinter::runOnMachineFunction(), LinuxAsmPrinter::runOnMachineFunction(), PPCDarwinAsmPrinter::runOnMachineFunction(), PPCLinuxAsmPrinter::runOnMachineFunction(), ARMAsmPrinter::runOnMachineFunction(), AlphaAsmPrinter::runOnMachineFunction(), llvm::ELFTargetAsmInfo::SelectSectionForGlobal(), and llvm::DIVerifier::Verify().

const Module* llvm::GlobalValue::getParent  )  const [inline]
 

Definition at line 148 of file GlobalValue.h.

Module* llvm::GlobalValue::getParent  )  [inline]
 

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

Definition at line 147 of file GlobalValue.h.

Referenced by PrintFOpt::CallOptimizer(), FFSOpt::CallOptimizer(), createSlotTracker(), LibCallOptimization::EmitFPutC(), LibCallOptimization::EmitFPutS(), PIC16AsmPrinter::emitFunctionStart(), LibCallOptimization::EmitFWrite(), LibCallOptimization::EmitMemChr(), LibCallOptimization::EmitMemCpy(), LibCallOptimization::EmitPutChar(), LibCallOptimization::EmitPutS(), LibCallOptimization::EmitStrLen(), LibCallOptimization::EmitUnaryFloatFnCall(), llvm::GlobalAlias::eraseFromParent(), llvm::GlobalVariable::eraseFromParent(), llvm::Function::eraseFromParent(), CodeExtractor::ExtractCodeRegion(), ForceRenaming(), llvm::GCModuleInfo::getFunctionInfo(), llvm::Trace::getModule(), getModuleFromVal(), llvm::CallGraph::getOrInsertFunction(), llvm::JIT::getPointerToFunction(), getSymTab(), llvm::GlobalVariable::GlobalVariable(), llvm::InlineFunction(), llvm::BasicInlinerImpl::inlineFunctions(), llvm::InsertProfilingInitCall(), InstallGlobalCtors(), LLVMGetNextFunction(), LLVMGetNextGlobal(), LLVMGetPreviousFunction(), LLVMGetPreviousGlobal(), LowerPartSelect(), LowerPartSet(), OptimizeGlobalAddressOfMalloc(), llvm::Value::print(), PrintOps(), llvm::GlobalAlias::removeFromParent(), llvm::GlobalVariable::removeFromParent(), llvm::Function::removeFromParent(), ReplaceCallWith(), llvm::FunctionPass::run(), llvm::JIT::runFunction(), Verifier::runOnFunction(), AAEval::runOnFunction(), llvm::Inliner::runOnSCC(), SRAGlobal(), TryToShrinkGlobalToBoolean(), UpgradeIntrinsicFunction1(), llvm::verifyFunction(), InstCombiner::visitCallInst(), and Verifier::visitInstruction().

const std::string& llvm::GlobalValue::getSection  )  const [inline]
 

Definition at line 86 of file GlobalValue.h.

Referenced by copyAttributesFrom(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), getGlobalVariableClass(), LinkAppendingVars(), ConstantMerge::runOnModule(), llvm::TargetAsmInfo::SectionForGlobal(), llvm::AsmPrinter::SwitchToDataSection(), and llvm::AsmPrinter::SwitchToTextSection().

const PointerType* llvm::GlobalValue::getType  )  const [inline]
 

getType - Global values are always pointers.

Reimplemented from llvm::Value.

Definition at line 97 of file GlobalValue.h.

References llvm::Intrinsic::getType().

Referenced by DIDeserializeVisitor::Apply(), llvm::Interpreter::callExternalFunction(), llvm::ComputeMaskedBits(), llvm::ExecutionEngine::emitGlobals(), llvm::ExecutionEngine::EmitGlobalVariable(), EvaluateStaticConstructor(), llvm::Function::getFunctionType(), llvm::JIT::getOrEmitGlobalVariable(), Module::getOrInsertFunction(), llvm::TargetData::getPreferredAlignment(), llvm::Mangler::getValueName(), llvm::InsertProfilingInitCall(), InstallGlobalCtors(), isObjectSmallerThan(), LinkAlias(), LinkAppendingVars(), LinkFunctionProtos(), LinkGlobals(), OptimizeGlobalAddressOfMalloc(), CBackendNameAllUsedStructsAndMergeFunctions::runOnModule(), llvm::MipsTargetAsmInfo::SectionKindForGlobal(), llvm::GlobalAlias::setAliasee(), SRAGlobal(), llvm::MachOCodeEmitter::startFunction(), SCCPSolver::TrackValueOfGlobalVariable(), TryToShrinkGlobalToBoolean(), Verifier::visitGlobalAlias(), Verifier::visitGlobalValue(), and Verifier::visitGlobalVariable().

VisibilityTypes llvm::GlobalValue::getVisibility  )  const [inline]
 

Definition at line 78 of file GlobalValue.h.

Referenced by copyAttributesFrom(), llvm::X86ATTAsmPrinter::emitFunctionHeader(), MipsAsmPrinter::emitFunctionStart(), getEncodedVisibility(), GetLinkageResult(), LinkAppendingVars(), LinkFunctionProtos(), LinkGlobals(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), SparcAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), MipsAsmPrinter::printModuleLevelGV(), IA64AsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), AlphaAsmPrinter::printModuleLevelGV(), SparcAsmPrinter::runOnMachineFunction(), PPCDarwinAsmPrinter::runOnMachineFunction(), PPCLinuxAsmPrinter::runOnMachineFunction(), IA64AsmPrinter::runOnMachineFunction(), ARMAsmPrinter::runOnMachineFunction(), and AlphaAsmPrinter::runOnMachineFunction().

bool llvm::GlobalValue::hasAppendingLinkage  )  const [inline]
 

Definition at line 105 of file GlobalValue.h.

Referenced by llvm::ExecutionEngine::emitGlobals(), llvm::AsmPrinter::EmitSpecialLLVMGlobal(), getGlobalVariableClass(), GetLinkageResult(), LinkGlobalInits(), LinkGlobals(), and Verifier::visitGlobalValue().

bool llvm::GlobalValue::hasCommonLinkage  )  const [inline]
 

Definition at line 104 of file GlobalValue.h.

Referenced by GetLinkageResult(), llvm::X86Subtarget::GVRequiresExtraLoad(), llvm::PPCSubtarget::hasLazyResolverStub(), PPCAsmPrinter::printCallOperand(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), SPUAsmPrinter::printOp(), and PPCAsmPrinter::printOp().

bool llvm::GlobalValue::hasDLLExportLinkage  )  const [inline]
 

Definition at line 108 of file GlobalValue.h.

Referenced by llvm::ExecutionEngine::emitGlobals(), GetLinkageResult(), and llvm::X86ATTAsmPrinter::runOnMachineFunction().

bool llvm::GlobalValue::hasDLLImportLinkage  )  const [inline]
 

Definition at line 107 of file GlobalValue.h.

Referenced by llvm::ExecutionEngine::emitGlobals(), GetLinkageResult(), llvm::X86Subtarget::GVRequiresExtraLoad(), InsertName(), LinkGlobals(), llvm::X86IntelAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), SimplifyLibCalls::runOnFunction(), Verifier::visitGlobalValue(), and Verifier::visitGlobalVariable().

bool llvm::GlobalValue::hasExternalLinkage  )  const [inline]
 

Definition at line 101 of file GlobalValue.h.

Referenced by CalculateAliasLinkage(), X86DAGToDAGISel::EmitFunctionEntryCode(), llvm::ExecutionEngine::emitGlobals(), GetLinkageResult(), ShadowStackGC::initializeCustomLowering(), InsertName(), isSimpleEnoughPointerToCommit(), LinkGlobalInits(), LinkGlobals(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), SimplifyLibCalls::runOnFunction(), Verifier::visitGlobalAlias(), Verifier::visitGlobalValue(), and Verifier::visitGlobalVariable().

bool llvm::GlobalValue::hasExternalWeakLinkage  )  const [inline]
 

Definition at line 109 of file GlobalValue.h.

Referenced by llvm::ConstantFoldCompareInstruction(), LinuxAsmPrinter::doFinalization(), PIC16AsmPrinter::doFinalization(), llvm::AsmPrinter::doFinalization(), llvm::ExecutionEngine::emitGlobals(), PIC16AsmPrinter::EmitMachineConstantPoolValue(), ARMAsmPrinter::EmitMachineConstantPoolValue(), evaluateICmpRelation(), GetLinkageResult(), isKnownNonNull(), isSafeToLoadUnconditionally(), LinkGlobals(), PPCAsmPrinter::printCallOperand(), PIC16AsmPrinter::printCPInstOperand(), ARMAsmPrinter::printCPInstOperand(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), AlphaAsmPrinter::printModuleLevelGV(), SPUAsmPrinter::printOp(), PPCAsmPrinter::printOp(), AlphaAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), ARMAsmPrinter::printOperand(), Verifier::visitGlobalValue(), and Verifier::visitGlobalVariable().

bool llvm::GlobalValue::hasGhostLinkage  )  const [inline]
 

Definition at line 110 of file GlobalValue.h.

Referenced by Verifier::visitGlobalValue().

bool llvm::GlobalValue::hasHiddenVisibility  )  const [inline]
 

Definition at line 79 of file GlobalValue.h.

Referenced by llvm::X86Subtarget::GVRequiresExtraLoad(), llvm::X86TargetLowering::IsEligibleForTailCallOptimization(), llvm::PPCTargetLowering::IsEligibleForTailCallOptimization(), llvm::MachOSym::MachOSym(), and llvm::X86ATTAsmPrinter::printOperand().

bool llvm::GlobalValue::hasInternalLinkage  )  const [inline]
 

Definition at line 106 of file GlobalValue.h.

Referenced by SCCPSolver::AddTrackedFunction(), CalculateAliasLinkage(), GVExtractorPass::deleteGV(), llvm::Inliner::doFinalization(), llvm::ExecutionEngine::emitGlobals(), ForceRenaming(), Module::getGlobalVariable(), llvm::InlineCostAnalyzer::getInlineCost(), GetLinkageResult(), GlobalsModRef::getModRefInfo(), Module::getOrInsertFunction(), MSILWriter::getValueLocation(), llvm::X86Subtarget::GVRequiresExtraLoad(), InlineCallIfPossible(), llvm::BasicInlinerImpl::inlineFunctions(), isSimpleEnoughPointerToCommit(), LinkAlias(), LinkFunctionProtos(), LinkGlobals(), llvm::AlphaTargetLowering::LowerOperation(), MSILWriter::printFunction(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), SparcAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), MipsAsmPrinter::printModuleLevelGV(), IA64AsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), llvm::X86ATTAsmPrinter::printOperand(), RemoveDeadConstant(), StripSymbols::runOnModule(), ConstantMerge::runOnModule(), llvm::ExecutionEngine::runStaticConstructorsDestructors(), SRAGlobal(), llvm::SelectionDAGLowering::visitCall(), Verifier::visitGlobalAlias(), and Verifier::visitGlobalValue().

bool llvm::GlobalValue::hasLinkOnceLinkage  )  const [inline]
 

Definition at line 102 of file GlobalValue.h.

Referenced by llvm::Inliner::doFinalization(), getGlobalVariablesUsing(), GetLinkageResult(), GVIsIndirectSymbol(), llvm::X86Subtarget::GVRequiresExtraLoad(), llvm::PPCSubtarget::hasLazyResolverStub(), PPCAsmPrinter::printCallOperand(), SPUAsmPrinter::printOp(), PPCAsmPrinter::printOp(), and ARMAsmPrinter::printOperand().

bool llvm::GlobalValue::hasNotBeenReadFromBitcode  )  const [inline]
 

hasNotBeenReadFromBitcode - If a module provider is being used to lazily stream in functions from disk, this method can be used to check to see if the function has been read in yet or not. Unless you are working on the JIT or something else that streams stuff in lazily, you don't need to worry about this.

Definition at line 132 of file GlobalValue.h.

Referenced by llvm::BitcodeReader::dematerializeFunction(), JITResolver::getFunctionStub(), llvm::JIT::getPointerToFunction(), GVIsIndirectSymbol(), llvm::X86Subtarget::GVRequiresExtraLoad(), llvm::PPCSubtarget::hasLazyResolverStub(), llvm::BitcodeReader::materializeFunction(), and llvm::BitcodeReader::materializeModule().

bool llvm::GlobalValue::hasProtectedVisibility  )  const [inline]
 

Definition at line 80 of file GlobalValue.h.

Referenced by llvm::X86TargetLowering::IsEligibleForTailCallOptimization(), llvm::PPCTargetLowering::IsEligibleForTailCallOptimization(), and llvm::X86ATTAsmPrinter::printOperand().

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

Definition at line 85 of file GlobalValue.h.

Referenced by llvm::X86ATTAsmPrinter::printModuleLevelGV(), SparcAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), MipsAsmPrinter::printModuleLevelGV(), IA64AsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), llvm::TargetAsmInfo::SectionForGlobal(), llvm::AsmPrinter::SwitchToDataSection(), and llvm::AsmPrinter::SwitchToTextSection().

bool llvm::GlobalValue::hasWeakLinkage  )  const [inline]
 

Definition at line 103 of file GlobalValue.h.

Referenced by CalculateAliasLinkage(), llvm::InlineCostAnalyzer::getInlineCost(), GetLinkageResult(), GVIsIndirectSymbol(), llvm::X86Subtarget::GVRequiresExtraLoad(), llvm::PPCSubtarget::hasLazyResolverStub(), PPCAsmPrinter::printCallOperand(), SPUAsmPrinter::printOp(), PPCAsmPrinter::printOp(), ARMAsmPrinter::printOperand(), PruneEH::runOnSCC(), Verifier::visitGlobalAlias(), and Verifier::visitGlobalValue().

virtual bool llvm::GlobalValue::isDeclaration  )  const [pure virtual]
 

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

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

Referenced by llvm::ExecutionEngine::emitGlobals(), EnforceKnownAlignment(), GetLinkageResult(), GVIsIndirectSymbol(), llvm::X86Subtarget::GVRequiresExtraLoad(), llvm::PPCSubtarget::hasLazyResolverStub(), InsertName(), llvm::GlobalAlias::isDeclaration(), LinkFunctionProtos(), LinkGlobals(), LowerCALL(), LowerToTLSExecModel(), PPCAsmPrinter::printCallOperand(), SPUAsmPrinter::printOp(), PPCAsmPrinter::printOp(), IA64AsmPrinter::printOp(), AlphaAsmPrinter::printOp(), llvm::X86ATTAsmPrinter::printOperand(), ARMAsmPrinter::printOperand(), ResolveAliases(), and Verifier::visitGlobalValue().

virtual bool llvm::GlobalValue::isNullValue  )  const [inline, virtual]
 

Override from Constant class. No GlobalValue's are null values so this always returns false.

Implements llvm::Constant.

Definition at line 136 of file GlobalValue.h.

bool llvm::GlobalValue::isWeakForLinker  )  const [inline]
 

isWeakForLinker - Determines if symbol is weak for linker having weak or linkonce or common or extweak LLVM linkage.

Definition at line 116 of file GlobalValue.h.

Referenced by GetLinkageResult(), LinkAlias(), LinkGlobalInits(), llvm::X86ATTAsmPrinter::printModuleLevelGV(), SparcAsmPrinter::printModuleLevelGV(), PPCDarwinAsmPrinter::printModuleLevelGV(), PPCLinuxAsmPrinter::printModuleLevelGV(), MipsAsmPrinter::printModuleLevelGV(), IA64AsmPrinter::printModuleLevelGV(), ARMAsmPrinter::printModuleLevelGV(), llvm::X86ATTAsmPrinter::printOperand(), llvm::TargetAsmInfo::SectionFlagsForGlobal(), llvm::TargetAsmInfo::SelectSectionForGlobal(), llvm::MipsTargetAsmInfo::SelectSectionForGlobal(), llvm::ELFTargetAsmInfo::SelectSectionForGlobal(), and llvm::DarwinTargetAsmInfo::SelectSectionForGlobal().

void GlobalValue::removeDeadConstantUsers  ) 
 

removeDeadConstantUsers - If there are any dead constant users dangling off of this global value, remove them. This method is useful for clients that want to check to see if a global is unused, but don't want to deal with potentially dead constants hanging off of the globals.

Definition at line 49 of file Globals.cpp.

References removeDeadUsersOfConstant(), llvm::Value::use_begin(), llvm::Value::use_end(), and llvm::Value::use_iterator.

Referenced by AddressIsTaken(), llvm::Inliner::doFinalization(), and ConstantMerge::runOnModule().

void llvm::GlobalValue::setAlignment unsigned  Align  )  [inline]
 

Definition at line 73 of file GlobalValue.h.

Referenced by copyAttributesFrom(), CopyGVAttributes(), EnforceKnownAlignment(), LinkGlobals(), and SRAGlobal().

void llvm::GlobalValue::setLinkage LinkageTypes  LT  )  [inline]
 

Definition at line 111 of file GlobalValue.h.

Referenced by llvm::CloneModule(), GVExtractorPass::deleteGV(), llvm::BitcodeReader::dematerializeFunction(), ShadowStackGC::initializeCustomLowering(), GVExtractorPass::isolateGV(), LinkAlias(), LinkFunctionProtos(), LinkGlobals(), LowerPartSelect(), LowerPartSet(), llvm::BitcodeReader::materializeFunction(), and InternalizePass::runOnModule().

void llvm::GlobalValue::setSection const std::string &  S  )  [inline]
 

Definition at line 87 of file GlobalValue.h.

Referenced by DISerializeVisitor::Apply(), copyAttributesFrom(), llvm::DISerializer::getString(), GVExtractorPass::isolateGV(), and llvm::DISerializer::Serialize().

void llvm::GlobalValue::setVisibility VisibilityTypes  V  )  [inline]
 

Definition at line 83 of file GlobalValue.h.

Referenced by copyAttributesFrom(), LinkFunctionProtos(), and LinkGlobals().

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

LinkageTypes llvm::GlobalValue::Linkage [protected]
 

Definition at line 63 of file GlobalValue.h.

Module* llvm::GlobalValue::Parent [protected]
 

Definition at line 60 of file GlobalValue.h.

std::string llvm::GlobalValue::Section [protected]
 

Definition at line 66 of file GlobalValue.h.

unsigned llvm::GlobalValue::Visibility [protected]
 

Definition at line 64 of file GlobalValue.h.


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


This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.