class Argument
Declaration
class Argument : public Value { /* full declaration omitted */ };
Description
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.
Declared at: llvm/include/llvm/IR/Argument.h:29
Inherits from: Value
Member Variables
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 29
- public static MaximumAlignment = 1U << MaxAlignmentExponent
Method Overview
- public Argument(llvm::Type * Ty, const llvm::Twine & Name = "", llvm::Function * F = nullptr, unsigned int ArgNo = 0)
- public void addAttr(llvm::Attribute Attr)
- public void addAttr(Attribute::AttrKind Kind)
- public void addAttrs(llvm::AttrBuilder & B)
- public static bool classof(const llvm::Value * V)
- public unsigned int getArgNo() const
- public llvm::Attribute getAttribute(Attribute::AttrKind Kind) const
- public uint64_t getDereferenceableBytes() const
- public uint64_t getDereferenceableOrNullBytes() const
- public llvm::MaybeAlign getParamAlign() const
- public unsigned int getParamAlignment() const
- public llvm::Type * getParamByValType() const
- public inline const llvm::Function * getParent() const
- public inline llvm::Function * getParent()
- public bool hasAttribute(Attribute::AttrKind Kind) const
- public bool hasByValAttr() const
- public bool hasByValOrInAllocaAttr() const
- public bool hasInAllocaAttr() const
- public bool hasInRegAttr() const
- public bool hasNestAttr() const
- public bool hasNoAliasAttr() const
- public bool hasNoCaptureAttr() const
- public bool hasNonNullAttr() const
- public bool hasReturnedAttr() const
- public bool hasSExtAttr() const
- public bool hasStructRetAttr() const
- public bool hasSwiftErrorAttr() const
- public bool hasSwiftSelfAttr() const
- public bool hasZExtAttr() const
- public bool onlyReadsMemory() const
- public void removeAttr(Attribute::AttrKind Kind)
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public clearSubclassOptionalData
- public deleteValue
- public dump
- public getContext
- public getName
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- protected getSubclassDataFromValue
- public getType
- public getValueID
- public getValueName
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isUsedByMetadata
- public isUsedInBasicBlock
- public materialized_use_begin
- public materialized_use_begin
- public materialized_use_empty
- public materialized_user_begin
- public materialized_user_begin
- public materialized_users
- public materialized_users
- public materialized_uses
- public materialized_uses
- public mutateType
- public print
- public print
- public printAsOperand
- public printAsOperand
- public replaceAllUsesWith
- public replaceNonMetadataUsesWith
- public replaceUsesOutsideBlock
- public replaceUsesWithIf
- public reverseUseList
- public setName
- public setValueName
- protected setValueSubclassData
- public sortUseList
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripAndAccumulateInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsConstantOffsets
- public stripInBoundsOffsets
- public stripInBoundsOffsets
- public stripPointerCasts
- public stripPointerCasts
- public stripPointerCastsAndAliases
- public stripPointerCastsAndAliases
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsAndInvariantGroups
- public stripPointerCastsSameRepresentation
- public stripPointerCastsSameRepresentation
- public takeName
- public use_begin
- public use_begin
- public use_empty
- public use_end
- public use_end
- public user_back
- public user_back
- public user_begin
- public user_begin
- public user_empty
- public user_end
- public user_end
- public users
- public users
- public uses
- public uses
Methods
¶Argument(llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Function* F = nullptr,
unsigned int ArgNo = 0)
Argument(llvm::Type* Ty,
const llvm::Twine& Name = "",
llvm::Function* F = nullptr,
unsigned int ArgNo = 0)
Description
Argument constructor.
Declared at: llvm/include/llvm/IR/Argument.h:38
Parameters
- llvm::Type* Ty
- const llvm::Twine& Name = ""
- llvm::Function* F = nullptr
- unsigned int ArgNo = 0
¶void addAttr(llvm::Attribute Attr)
void addAttr(llvm::Attribute Attr)
Declared at: llvm/include/llvm/IR/Argument.h:124
Parameters
- llvm::Attribute Attr
¶void addAttr(Attribute::AttrKind Kind)
void addAttr(Attribute::AttrKind Kind)
Declared at: llvm/include/llvm/IR/Argument.h:122
Parameters
- Attribute::AttrKind Kind
¶void addAttrs(llvm::AttrBuilder& B)
void addAttrs(llvm::AttrBuilder& B)
Description
Add attributes to an argument.
Declared at: llvm/include/llvm/IR/Argument.h:120
Parameters
¶static bool classof(const llvm::Value* V)
static bool classof(const llvm::Value* V)
Description
Method for support type inquiry through isa, cast, and dyn_cast.
Declared at: llvm/include/llvm/IR/Argument.h:135
Parameters
- const llvm::Value* V
¶unsigned int getArgNo() const
unsigned int getArgNo() const
Description
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.
Declared at: llvm/include/llvm/IR/Argument.h:47
¶llvm::Attribute getAttribute(
Attribute::AttrKind Kind) const
llvm::Attribute getAttribute(
Attribute::AttrKind Kind) const
Declared at: llvm/include/llvm/IR/Argument.h:132
Parameters
- Attribute::AttrKind Kind
¶uint64_t getDereferenceableBytes() const
uint64_t getDereferenceableBytes() const
Description
If this argument has the dereferenceable attribute, return the number of bytes known to be dereferenceable. Otherwise, zero is returned.
Declared at: llvm/include/llvm/IR/Argument.h:59
¶uint64_t getDereferenceableOrNullBytes() const
uint64_t getDereferenceableOrNullBytes() const
Description
If this argument has the dereferenceable_or_null attribute, return the number of bytes known to be dereferenceable. Otherwise, zero is returned.
Declared at: llvm/include/llvm/IR/Argument.h:63
¶llvm::MaybeAlign getParamAlign() const
llvm::MaybeAlign getParamAlign() const
Description
If this is a byval or inalloca argument, return its alignment.
Declared at: llvm/include/llvm/IR/Argument.h:84
¶unsigned int getParamAlignment() const
unsigned int getParamAlignment() const
Description
If this is a byval or inalloca argument, return its alignment. FIXME: Remove this function once transition to Align is over. Use getParamAlign() instead.
Declared at: llvm/include/llvm/IR/Argument.h:81
¶llvm::Type* getParamByValType() const
llvm::Type* getParamByValType() const
Description
If this is a byval argument, return its type.
Declared at: llvm/include/llvm/IR/Argument.h:87
¶inline const llvm::Function* getParent() const
inline const llvm::Function* getParent() const
Declared at: llvm/include/llvm/IR/Argument.h:41
¶inline llvm::Function* getParent()
inline llvm::Function* getParent()
Declared at: llvm/include/llvm/IR/Argument.h:42
¶bool hasAttribute(Attribute::AttrKind Kind) const
bool hasAttribute(Attribute::AttrKind Kind) const
Description
Check if an argument has a given attribute.
Declared at: llvm/include/llvm/IR/Argument.h:130
Parameters
- Attribute::AttrKind Kind
¶bool hasByValAttr() const
bool hasByValAttr() const
Description
Return true if this argument has the byval attribute.
Declared at: llvm/include/llvm/IR/Argument.h:66
¶bool hasByValOrInAllocaAttr() const
bool hasByValOrInAllocaAttr() const
Description
Return true if this argument has the byval attribute or inalloca attribute. These attributes represent arguments being passed by value.
Declared at: llvm/include/llvm/IR/Argument.h:76
¶bool hasInAllocaAttr() const
bool hasInAllocaAttr() const
Description
Return true if this argument has the inalloca attribute.
Declared at: llvm/include/llvm/IR/Argument.h:111
¶bool hasInRegAttr() const
bool hasInRegAttr() const
Description
Return true if this argument has the inreg attribute.
Declared at: llvm/include/llvm/IR/Argument.h:102
¶bool hasNestAttr() const
bool hasNestAttr() const
Description
Return true if this argument has the nest attribute.
Declared at: llvm/include/llvm/IR/Argument.h:90
¶bool hasNoAliasAttr() const
bool hasNoAliasAttr() const
Description
Return true if this argument has the noalias attribute.
Declared at: llvm/include/llvm/IR/Argument.h:93
¶bool hasNoCaptureAttr() const
bool hasNoCaptureAttr() const
Description
Return true if this argument has the nocapture attribute.
Declared at: llvm/include/llvm/IR/Argument.h:96
¶bool hasNonNullAttr() const
bool hasNonNullAttr() const
Description
Return true if this argument has the nonnull attribute. Also returns true if at least one byte is known to be dereferenceable and the pointer is in addrspace(0).
Declared at: llvm/include/llvm/IR/Argument.h:55
¶bool hasReturnedAttr() const
bool hasReturnedAttr() const
Description
Return true if this argument has the returned attribute.
Declared at: llvm/include/llvm/IR/Argument.h:105
¶bool hasSExtAttr() const
bool hasSExtAttr() const
Description
Return true if this argument has the sext attribute.
Declared at: llvm/include/llvm/IR/Argument.h:117
¶bool hasStructRetAttr() const
bool hasStructRetAttr() const
Description
Return true if this argument has the sret attribute.
Declared at: llvm/include/llvm/IR/Argument.h:99
¶bool hasSwiftErrorAttr() const
bool hasSwiftErrorAttr() const
Description
Return true if this argument has the swifterror attribute.
Declared at: llvm/include/llvm/IR/Argument.h:72
¶bool hasSwiftSelfAttr() const
bool hasSwiftSelfAttr() const
Description
Return true if this argument has the swiftself attribute.
Declared at: llvm/include/llvm/IR/Argument.h:69
¶bool hasZExtAttr() const
bool hasZExtAttr() const
Description
Return true if this argument has the zext attribute.
Declared at: llvm/include/llvm/IR/Argument.h:114
¶bool onlyReadsMemory() const
bool onlyReadsMemory() const
Description
Return true if this argument has the readonly or readnone attribute.
Declared at: llvm/include/llvm/IR/Argument.h:108
¶void removeAttr(Attribute::AttrKind Kind)
void removeAttr(Attribute::AttrKind Kind)
Description
Remove attributes from an argument.
Declared at: llvm/include/llvm/IR/Argument.h:127
Parameters
- Attribute::AttrKind Kind