LLVM API Documentation
LLVM Argument representation. More...
#include <Argument.h>


Public Member Functions | |
| Argument (Type *Ty, const Twine &Name="", Function *F=0) | |
| Constructor. | |
| const Function * | getParent () const |
| Function * | getParent () |
| unsigned | getArgNo () const |
| Return the index of this formal argument in its containing function. | |
| bool | hasByValAttr () const |
| Return true if this argument has the byval attribute on it in its containing function. | |
| unsigned | getParamAlignment () const |
| If this is a byval argument, return its alignment. | |
| bool | hasNestAttr () const |
| Return true if this argument has the nest attribute on it in its containing function. | |
| bool | hasNoAliasAttr () const |
| Return true if this argument has the noalias attribute on it in its containing function. | |
| bool | hasNoCaptureAttr () const |
| Return true if this argument has the nocapture attribute on it in its containing function. | |
| bool | hasStructRetAttr () const |
| Return true if this argument has the sret attribute on it in its containing function. | |
| bool | hasReturnedAttr () const |
| Return true if this argument has the returned attribute on it in its containing function. | |
| void | addAttr (AttributeSet AS) |
| Add a Attribute to an argument. | |
| void | removeAttr (AttributeSet AS) |
| Remove a Attribute from an argument. | |
Static Public Member Functions | |
| static bool | classof (const Value *V) |
| Method for support type inquiry through isa, cast, and dyn_cast. | |
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(), and llvm::Value::setName().
| void Argument::addAttr | ( | AttributeSet | AS | ) |
Add a Attribute to an argument.
addAttr - Add attributes to an argument.
Definition at line 135 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 93 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(), getParamAlignment(), hasByValAttr(), hasNestAttr(), hasNoAliasAttr(), hasNoCaptureAttr(), hasReturnedAttr(), LLVMAddAttribute(), LLVMGetAttribute(), LLVMRemoveAttribute(), LLVMSetParamAlignment(), 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().
| const Function* llvm::Argument::getParent | ( | ) | const [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(), and removeAttr().
| Function* llvm::Argument::getParent | ( | ) | [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.
| void Argument::removeAttr | ( | AttributeSet | AS | ) |
Remove a Attribute from an argument.
removeAttr - Remove attributes from an argument.
Definition at line 145 of file Function.cpp.
References getArgNo(), llvm::Function::getContext(), llvm::AttributeSet::getNumSlots(), getParent(), llvm::AttributeSet::getSlotIndex(), and llvm::Function::removeAttributes().
Referenced by LLVMRemoveAttribute().
friend class SymbolTableListTraits< Argument, Function > [friend] |
Definition at line 39 of file Argument.h.