LLVM API Documentation
LLVM Argument representation. More...
#include <Argument.h>
Public Member Functions | |
Argument (Type *Ty, const Twine &Name="", Function *F=0) | |
Constructor. More... | |
const Function * | getParent () const |
Function * | getParent () |
unsigned | getArgNo () const |
Return the index of this formal argument in its containing function. More... | |
bool | hasByValAttr () const |
Return true if this argument has the byval attribute on it in its containing function. More... | |
unsigned | getParamAlignment () const |
If this is a byval argument, return its alignment. More... | |
bool | hasNestAttr () const |
Return true if this argument has the nest attribute on it in its containing function. More... | |
bool | hasNoAliasAttr () const |
Return true if this argument has the noalias attribute on it in its containing function. More... | |
bool | hasNoCaptureAttr () const |
Return true if this argument has the nocapture attribute on it in its containing function. More... | |
bool | hasStructRetAttr () const |
Return true if this argument has the sret attribute on it in its containing function. More... | |
bool | hasReturnedAttr () const |
Return true if this argument has the returned attribute on it in its containing function. More... | |
bool | onlyReadsMemory () const |
Return true if this argument has the readonly or readnone attribute on it in its containing function. More... | |
void | addAttr (AttributeSet AS) |
Add a Attribute to an argument. More... | |
void | removeAttr (AttributeSet AS) |
Remove a Attribute from an argument. More... | |
![]() | |
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) |
![]() | |
Argument * | getPrevNode () |
Get the previous node, or 0 for the list head. More... | |
const Argument * | getPrevNode () const |
Get the previous node, or 0 for the list head. More... | |
Argument * | getNextNode () |
Get the next node, or 0 for the list tail. More... | |
const Argument * | getNextNode () const |
Get the next node, or 0 for the list tail. More... | |
Static Public Member Functions | |
static bool | classof (const Value *V) |
Method for support type inquiry through isa, cast, and dyn_cast. More... | |
Friends | |
class | SymbolTableListTraits< Argument, Function > |
LLVM Argument representation.
This class represents an incoming formal argument to a Function. A formal argument, since it is ``formal'', does not contain an actual value but instead represents the type, argument number, and attributes of an argument for a specific function. When used in the body of said function, the argument of course represents the value of the actual argument that the function was called with.
Definition at line 35 of file Argument.h.
Constructor.
If F
is specified, the argument is inserted at the end of the argument list for F
.
Definition at line 45 of file Function.cpp.
References llvm::LeakDetector::addGarbageObject(), llvm::Function::getArgumentList(), llvm::iplist< NodeTy, Traits >::push_back(), and llvm::Value::setName().
void Argument::addAttr | ( | AttributeSet | AS | ) |
Add a Attribute to an argument.
addAttr - Add attributes to an argument.
Definition at line 144 of file Function.cpp.
References llvm::Function::addAttributes(), getArgNo(), llvm::Function::getContext(), llvm::AttributeSet::getNumSlots(), getParent(), and llvm::AttributeSet::getSlotIndex().
Referenced by LLVMAddAttribute(), and LLVMSetParamAlignment().
Method for support type inquiry through isa, cast, and dyn_cast.
Definition at line 98 of file Argument.h.
References llvm::Value::ArgumentVal, and llvm::Value::getValueID().
unsigned Argument::getArgNo | ( | ) | const |
Return the index of this formal argument in its containing function.
For example in "void foo(int a, float b)" a is 0 and b is 1.
getArgNo - Return the index of this formal argument in its containing function. For example in "void foo(int a, float b)" a is 0 and b is 1.
Definition at line 67 of file Function.cpp.
References llvm::Function::arg_begin(), F(), and getParent().
Referenced by addAttr(), AllCallersPassInValidPointerForArgument(), getParamAlignment(), hasByValAttr(), hasNestAttr(), hasNoAliasAttr(), hasNoCaptureAttr(), hasReturnedAttr(), LLVMAddAttribute(), LLVMGetAttribute(), LLVMRemoveAttribute(), LLVMSetParamAlignment(), onlyReadsMemory(), and removeAttr().
unsigned Argument::getParamAlignment | ( | ) | const |
If this is a byval argument, return its alignment.
Definition at line 87 of file Function.cpp.
References getArgNo(), llvm::Function::getParamAlignment(), getParent(), and llvm::Value::getType().
Referenced by llvm::ObjectSizeOffsetVisitor::visitArgument().
|
inline |
Definition at line 49 of file Argument.h.
Referenced by addAttr(), AllCallersPassInValidPointerForArgument(), getArgNo(), getParamAlignment(), hasByValAttr(), hasNestAttr(), hasNoAliasAttr(), hasNoCaptureAttr(), hasReturnedAttr(), hasStructRetAttr(), isOnlyUsedInEntryBlock(), LLVMGetAttribute(), LLVMGetNextParam(), LLVMGetPreviousParam(), onlyReadsMemory(), and removeAttr().
|
inline |
Definition at line 50 of file Argument.h.
bool Argument::hasByValAttr | ( | ) | const |
Return true if this argument has the byval attribute on it in its containing function.
hasByValAttr - Return true if this argument has the byval attribute on it in its containing function.
Definition at line 81 of file Function.cpp.
References llvm::Attribute::ByVal, getArgNo(), llvm::Function::getAttributes(), getParent(), and llvm::Value::getType().
Referenced by llvm::ObjectSizeOffsetVisitor::visitArgument().
bool Argument::hasNestAttr | ( | ) | const |
Return true if this argument has the nest attribute on it in its containing function.
hasNestAttr - Return true if this argument has the nest attribute on it in its containing function.
Definition at line 95 of file Function.cpp.
References getArgNo(), llvm::Function::getAttributes(), getParent(), llvm::Value::getType(), and llvm::Attribute::Nest.
bool Argument::hasNoAliasAttr | ( | ) | const |
Return true if this argument has the noalias attribute on it in its containing function.
hasNoAliasAttr - Return true if this argument has the noalias attribute on it in its containing function.
Definition at line 103 of file Function.cpp.
References getArgNo(), llvm::Function::getAttributes(), getParent(), llvm::Value::getType(), and llvm::Attribute::NoAlias.
bool Argument::hasNoCaptureAttr | ( | ) | const |
Return true if this argument has the nocapture attribute on it in its containing function.
hasNoCaptureAttr - Return true if this argument has the nocapture attribute on it in its containing function.
Definition at line 111 of file Function.cpp.
References getArgNo(), llvm::Function::getAttributes(), getParent(), llvm::Value::getType(), and llvm::Attribute::NoCapture.
bool Argument::hasReturnedAttr | ( | ) | const |
Return true if this argument has the returned attribute on it in its containing function.
hasReturnedAttr - Return true if this argument has the returned attribute on it in its containing function.
Definition at line 129 of file Function.cpp.
References getArgNo(), llvm::Function::getAttributes(), getParent(), and llvm::Attribute::Returned.
bool Argument::hasStructRetAttr | ( | ) | const |
Return true if this argument has the sret attribute on it in its containing function.
hasSRetAttr - Return true if this argument has the sret attribute on it in its containing function.
Definition at line 119 of file Function.cpp.
References llvm::Function::getAttributes(), getParent(), llvm::Value::getType(), and llvm::Attribute::StructRet.
bool Argument::onlyReadsMemory | ( | ) | const |
Return true if this argument has the readonly or readnone attribute on it in its containing function.
Return true if this argument has the readonly or readnone attribute on it in its containing function.
Definition at line 136 of file Function.cpp.
References getArgNo(), llvm::Function::getAttributes(), getParent(), llvm::Attribute::ReadNone, and llvm::Attribute::ReadOnly.
void Argument::removeAttr | ( | AttributeSet | AS | ) |
Remove a Attribute from an argument.
removeAttr - Remove attributes from an argument.
Definition at line 154 of file Function.cpp.
References getArgNo(), llvm::Function::getContext(), llvm::AttributeSet::getNumSlots(), getParent(), llvm::AttributeSet::getSlotIndex(), and llvm::Function::removeAttributes().
Referenced by LLVMRemoveAttribute().
|
friend |
Definition at line 39 of file Argument.h.