LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Friends | List of all members
llvm::GlobalAlias Class Reference

#include <GlobalAlias.h>

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

Public Member Functions

void * operator new (size_t s)
 
 GlobalAlias (Type *Ty, LinkageTypes Linkage, const Twine &Name="", Constant *Aliasee=0, Module *Parent=0)
 
 DECLARE_TRANSPARENT_OPERAND_ACCESSORS (Constant)
 Provide fast operand accessors. More...
 
virtual void removeFromParent ()
 
virtual void eraseFromParent ()
 
void setAliasee (Constant *GV)
 set/getAliasee - These methods retrive and set alias target. More...
 
const ConstantgetAliasee () const
 
ConstantgetAliasee ()
 
GlobalValuegetAliasedGlobal ()
 
const GlobalValuegetAliasedGlobal () const
 
GlobalValueresolveAliasedGlobal (bool stopOnWeak=true)
 
const GlobalValueresolveAliasedGlobal (bool stopOnWeak=true) const
 
- Public Member Functions inherited from llvm::GlobalValue
 ~GlobalValue ()
 
unsigned getAlignment () const
 
void setAlignment (unsigned Align)
 
bool hasUnnamedAddr () const
 
void setUnnamedAddr (bool Val)
 
VisibilityTypes getVisibility () const
 
bool hasDefaultVisibility () const
 
bool hasHiddenVisibility () const
 
bool hasProtectedVisibility () const
 
void setVisibility (VisibilityTypes V)
 
bool hasSection () const
 
const std::string & getSection () const
 
void setSection (StringRef S)
 
bool use_empty_except_constants ()
 Determine if the usage of this global value is empty except for transitively dead constants. More...
 
PointerTypegetType () const
 getType - Global values are always pointers. More...
 
bool hasExternalLinkage () const
 
bool hasAvailableExternallyLinkage () const
 
bool hasLinkOnceLinkage () const
 
bool hasWeakLinkage () const
 
bool hasAppendingLinkage () const
 
bool hasInternalLinkage () const
 
bool hasPrivateLinkage () const
 
bool hasLinkerPrivateLinkage () const
 
bool hasLinkerPrivateWeakLinkage () const
 
bool hasLocalLinkage () const
 
bool hasDLLImportLinkage () const
 
bool hasDLLExportLinkage () const
 
bool hasExternalWeakLinkage () const
 
bool hasCommonLinkage () const
 
void setLinkage (LinkageTypes LT)
 
LinkageTypes getLinkage () const
 
bool isDiscardableIfUnused () const
 
bool mayBeOverridden () const
 
bool isWeakForLinker () const
 
virtual void copyAttributesFrom (const GlobalValue *Src)
 
virtual void destroyConstant ()
 Override from Constant class. More...
 
bool isDeclaration () const
 
ModulegetParent ()
 
const ModulegetParent () const
 
bool isMaterializable () const
 
bool isDematerializable () const
 
bool Materialize (std::string *ErrInfo=0)
 
void Dematerialize ()
 
- Public Member Functions inherited from llvm::Constant
bool isNullValue () const
 
bool isAllOnesValue () const
 
bool isNegativeZeroValue () const
 
bool isZeroValue () const
 Return true if the value is negative zero or null value. More...
 
bool canTrap () const
 
bool isThreadDependent () const
 isThreadDependent - Return true if the value can vary between threads. More...
 
bool isConstantUsed () const
 
PossibleRelocationsTy getRelocationInfo () const
 
ConstantgetAggregateElement (unsigned Elt) const
 
ConstantgetAggregateElement (Constant *Elt) const
 
ConstantgetSplatValue () const
 
const APIntgetUniqueInteger () const
 
virtual void replaceUsesOfWithOnConstant (Value *, Value *, Use *)
 
void removeDeadConstantUsers () const
 
- Public Member Functions inherited from llvm::User
 ~User ()
 
void operator delete (void *Usr)
 operator delete - free memory allocated for User and Use objects More...
 
void operator delete (void *, unsigned)
 placement delete - required by std, but never called. More...
 
void operator delete (void *, unsigned, bool)
 placement delete - required by std, but never called. More...
 
ValuegetOperand (unsigned i) const
 
void setOperand (unsigned i, Value *Val)
 
const UsegetOperandUse (unsigned i) const
 
UsegetOperandUse (unsigned i)
 
unsigned getNumOperands () const
 
op_iterator op_begin ()
 
const_op_iterator op_begin () const
 
op_iterator op_end ()
 
const_op_iterator op_end () const
 
value_op_iterator value_op_begin ()
 
value_op_iterator value_op_end ()
 
void dropAllReferences ()
 
void replaceUsesOfWith (Value *From, Value *To)
 
- Public Member Functions inherited from llvm::Value
virtual ~Value ()
 
void dump () const
 dump - Support for debugging, callable in GDB: V->dump() More...
 
void print (raw_ostream &O, AssemblyAnnotationWriter *AAW=0) const
 
TypegetType () const
 
LLVMContextgetContext () const
 All values hold a context through their type. More...
 
bool hasName () const
 
ValueNamegetValueName () const
 
void setValueName (ValueName *VN)
 
StringRef getName () const
 
void setName (const Twine &Name)
 
void takeName (Value *V)
 
void replaceAllUsesWith (Value *V)
 
bool use_empty () const
 
use_iterator use_begin ()
 
const_use_iterator use_begin () const
 
use_iterator use_end ()
 
const_use_iterator use_end () const
 
Useruse_back ()
 
const Useruse_back () const
 
bool hasOneUse () const
 
bool hasNUses (unsigned N) const
 
bool hasNUsesOrMore (unsigned N) const
 
bool isUsedInBasicBlock (const BasicBlock *BB) const
 
unsigned getNumUses () const
 
void addUse (Use &U)
 
unsigned getValueID () const
 
unsigned getRawSubclassOptionalData () const
 
void clearSubclassOptionalData ()
 
bool hasSameSubclassOptionalData (const Value *V) const
 
void intersectOptionalDataWith (const Value *V)
 
bool hasValueHandle () const
 
ValuestripPointerCasts ()
 Strips off any unneeded pointer casts, all-zero GEPs and aliases from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCasts () const
 
ValuestripPointerCastsNoFollowAliases ()
 Strips off any unneeded pointer casts and all-zero GEPs from the specified value, returning the original uncasted value. More...
 
const ValuestripPointerCastsNoFollowAliases () const
 
ValuestripInBoundsConstantOffsets ()
 Strips off unneeded pointer casts and all-constant GEPs from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsConstantOffsets () const
 
ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset)
 Strips like stripInBoundsConstantOffsets but also accumulates the constant offset stripped. More...
 
const ValuestripAndAccumulateInBoundsConstantOffsets (const DataLayout &DL, APInt &Offset) const
 
ValuestripInBoundsOffsets ()
 Strips off unneeded pointer casts and any in-bounds offsets from the specified value, returning the original pointer value. More...
 
const ValuestripInBoundsOffsets () const
 
bool isDereferenceablePointer () const
 
ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB)
 
const ValueDoPHITranslation (const BasicBlock *CurBB, const BasicBlock *PredBB) const
 
void mutateType (Type *Ty)
 
- Public Member Functions inherited from llvm::ilist_node< GlobalAlias >
GlobalAliasgetPrevNode ()
 Get the previous node, or 0 for the list head. More...
 
const GlobalAliasgetPrevNode () const
 Get the previous node, or 0 for the list head. More...
 
GlobalAliasgetNextNode ()
 Get the next node, or 0 for the list tail. More...
 
const GlobalAliasgetNextNode () const
 Get the next node, or 0 for the list tail. More...
 

Static Public Member Functions

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

Friends

class SymbolTableListTraits< GlobalAlias, Module >
 

Additional Inherited Members

- Public Types inherited from llvm::GlobalValue
enum  LinkageTypes {
  ExternalLinkage = 0, AvailableExternallyLinkage, LinkOnceAnyLinkage, LinkOnceODRLinkage,
  WeakAnyLinkage, WeakODRLinkage, AppendingLinkage, InternalLinkage,
  PrivateLinkage, LinkerPrivateLinkage, LinkerPrivateWeakLinkage, DLLImportLinkage,
  DLLExportLinkage, ExternalWeakLinkage, CommonLinkage
}
 An enumeration for the kinds of linkage for global values. More...
 
enum  VisibilityTypes { DefaultVisibility = 0, HiddenVisibility, ProtectedVisibility }
 An enumeration for the kinds of visibility of global values. More...
 
- Public Types inherited from llvm::Constant
enum  PossibleRelocationsTy { NoRelocation = 0, LocalRelocation = 1, GlobalRelocations = 2 }
 
- Public Types inherited from llvm::User
typedef Useop_iterator
 
typedef const Useconst_op_iterator
 
- Public Types inherited from llvm::Value
enum  ValueTy {
  ArgumentVal, BasicBlockVal, FunctionVal, GlobalAliasVal,
  GlobalVariableVal, UndefValueVal, BlockAddressVal, ConstantExprVal,
  ConstantAggregateZeroVal, ConstantDataArrayVal, ConstantDataVectorVal, ConstantIntVal,
  ConstantFPVal, ConstantArrayVal, ConstantStructVal, ConstantVectorVal,
  ConstantPointerNullVal, MDNodeVal, MDStringVal, InlineAsmVal,
  PseudoSourceValueVal, FixedStackPseudoSourceValueVal, InstructionVal, ConstantFirstVal = FunctionVal,
  ConstantLastVal = ConstantPointerNullVal
}
 
typedef value_use_iterator< Useruse_iterator
 
typedef value_use_iterator
< const User
const_use_iterator
 
- Static Public Attributes inherited from llvm::Value
static const unsigned MaximumAlignment = 1u << 29
 
- Protected Member Functions inherited from llvm::GlobalValue
 GlobalValue (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps, LinkageTypes linkage, const Twine &Name)
 
- Protected Member Functions inherited from llvm::Constant
 Constant (Type *ty, ValueTy vty, Use *Ops, unsigned NumOps)
 
void destroyConstantImpl ()
 
- Protected Member Functions inherited from llvm::User
void * operator new (size_t s, unsigned Us)
 
 User (Type *ty, unsigned vty, Use *OpList, unsigned NumOps)
 
UseallocHungoffUses (unsigned) const
 
void dropHungoffUses ()
 
template<int Idx>
UseOp ()
 
template<int Idx>
const UseOp () const
 
- Protected Member Functions inherited from llvm::Value
virtual void printCustom (raw_ostream &O) const
 
 Value (Type *Ty, unsigned scid)
 
unsigned short getSubclassDataFromValue () const
 
void setValueSubclassData (unsigned short D)
 
- Protected Member Functions inherited from llvm::ilist_node< GlobalAlias >
 ilist_node ()
 
- Static Protected Member Functions inherited from llvm::User
template<int Idx, typename U >
static UseOpFrom (const U *that)
 
- Protected Attributes inherited from llvm::GlobalValue
LinkageTypes Linkage: 5
 
unsigned Visibility: 2
 
unsigned Alignment: 16
 
unsigned UnnamedAddr: 1
 
ModuleParent
 
std::string Section
 
- Protected Attributes inherited from llvm::User
UseOperandList
 
unsigned NumOperands
 
- Protected Attributes inherited from llvm::Value
unsigned char SubclassOptionalData: 7
 

Detailed Description

Definition at line 29 of file GlobalAlias.h.

Constructor & Destructor Documentation

GlobalAlias::GlobalAlias ( Type Ty,
LinkageTypes  Linkage,
const Twine Name = "",
Constant Aliasee = 0,
Module Parent = 0 
)

GlobalAlias ctor - If a parent module is specified, the alias is automatically inserted into the end of the specified module's alias list.

Definition at line 195 of file Globals.cpp.

References llvm::LeakDetector::addGarbageObject(), llvm::Module::getAliasList(), llvm::Value::getType(), and llvm::iplist< NodeTy, Traits >::push_back().

Member Function Documentation

static bool llvm::GlobalAlias::classof ( const Value V)
inlinestatic

Definition at line 90 of file GlobalAlias.h.

References llvm::Value::getValueID(), and llvm::Value::GlobalAliasVal.

llvm::GlobalAlias::DECLARE_TRANSPARENT_OPERAND_ACCESSORS ( Constant  )

Provide fast operand accessors.

void GlobalAlias::eraseFromParent ( )
virtual

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

Implements llvm::GlobalValue.

Definition at line 221 of file Globals.cpp.

References llvm::iplist< NodeTy, Traits >::erase(), llvm::Module::getAliasList(), and llvm::GlobalValue::getParent().

GlobalValue * GlobalAlias::getAliasedGlobal ( )

getAliasedGlobal() - Aliasee can be either global or bitcast of global. This method retrives the global for both aliasee flavours.

Definition at line 232 of file Globals.cpp.

References llvm::CallingConv::C, getAliasee(), llvm::ConstantExpr::getOpcode(), and llvm::User::getOperand().

Referenced by getAliasedGlobal(), and resolveAliasedGlobal().

const GlobalValue* llvm::GlobalAlias::getAliasedGlobal ( ) const
inline

Definition at line 70 of file GlobalAlias.h.

References getAliasedGlobal().

const Constant* llvm::GlobalAlias::getAliasee ( ) const
inline
Constant* llvm::GlobalAlias::getAliasee ( )
inline

Definition at line 64 of file GlobalAlias.h.

References llvm::User::getOperand().

static bool llvm::GlobalAlias::isValidLinkage ( LinkageTypes  L)
inlinestatic
void* llvm::GlobalAlias::operator new ( size_t  s)
inline

Definition at line 38 of file GlobalAlias.h.

void GlobalAlias::removeFromParent ( )
virtual

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

Implements llvm::GlobalValue.

Definition at line 217 of file Globals.cpp.

References llvm::Module::getAliasList(), llvm::GlobalValue::getParent(), and llvm::iplist< NodeTy, Traits >::remove().

GlobalValue * GlobalAlias::resolveAliasedGlobal ( bool  stopOnWeak = true)

resolveAliasedGlobal() - This method tries to ultimately resolve the alias by going through the aliasing chain and trying to find the very last global. Returns NULL if a cycle was found. If stopOnWeak is false, then the whole chain aliasing chain is traversed, otherwise - only strong aliases.

Definition at line 247 of file Globals.cpp.

References getAliasedGlobal(), llvm::SmallPtrSet< PtrType, SmallSize >::insert(), and llvm::GlobalValue::mayBeOverridden().

Referenced by resolveAliasedGlobal().

const GlobalValue* llvm::GlobalAlias::resolveAliasedGlobal ( bool  stopOnWeak = true) const
inline

Definition at line 80 of file GlobalAlias.h.

References resolveAliasedGlobal().

void GlobalAlias::setAliasee ( Constant GV)

set/getAliasee - These methods retrive and set alias target.

Definition at line 225 of file Globals.cpp.

References llvm::GlobalValue::getType(), llvm::Value::getType(), and llvm::User::setOperand().

Referenced by llvm::CloneModule().

Friends And Related Function Documentation

friend class SymbolTableListTraits< GlobalAlias, Module >
friend

Definition at line 30 of file GlobalAlias.h.


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