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:28
Inherits from: Value
Member Variables
- private llvm::Function* Parent
- private unsigned int ArgNo
Inherited from Value:
- protected SubclassOptionalData
- protected NumUserOperands
- protected IsUsedByMD
- protected HasName
- protected HasMetadata
- protected HasHungOffUses
- protected HasDescriptor
- public static MaxAlignmentExponent = 32
- public static MaximumAlignment = 1ULL << 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 uint64_t getParamAlignment() const
- public llvm::Type * getParamByRefType() const
- public llvm::Type * getParamByValType() const
- public llvm::Type * getParamInAllocaType() const
- public llvm::MaybeAlign getParamStackAlign() const
- public llvm::Type * getParamStructRetType() const
- public inline const llvm::Function * getParent() const
- public inline llvm::Function * getParent()
- public uint64_t getPassPointeeByValueCopySize(const llvm::DataLayout & DL) const
- public llvm::Type * getPointeeInMemoryValueType() const
- public bool hasAttribute(Attribute::AttrKind Kind) const
- public bool hasByRefAttr() const
- public bool hasByValAttr() const
- public bool hasInAllocaAttr() const
- public bool hasInRegAttr() const
- public bool hasNestAttr() const
- public bool hasNoAliasAttr() const
- public bool hasNoCaptureAttr() const
- public bool hasNoFreeAttr() const
- public bool hasNonNullAttr(bool AllowUndefOrPoison = true) const
- public bool hasPassPointeeByValueCopyAttr() const
- public bool hasPointeeInMemoryValueAttr() const
- public bool hasPreallocatedAttr() 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)
- public void removeAttrs(const llvm::AttributeMask & AM)
- private void setParent(llvm::Function * parent)
Inherited from Value:
- public DoPHITranslation
- public DoPHITranslation
- protected addMetadata
- protected addMetadata
- public addUse
- public assertModuleIsMaterialized
- public assertModuleIsMaterializedImpl
- public canBeFreed
- protected clearMetadata
- public clearSubclassOptionalData
- public deleteValue
- public dropDroppableUse
- public dropDroppableUses
- public dropDroppableUsesIn
- public dump
- protected eraseMetadata
- protected getAllMetadata
- public getContext
- protected getMetadata
- protected getMetadata
- protected getMetadata
- protected getMetadata
- public getName
- public getNameOrAsOperand
- public getNumUses
- public getPointerAlignment
- public getPointerDereferenceableBytes
- public getRawSubclassOptionalData
- public getSingleUndroppableUse
- public getSingleUndroppableUse
- protected getSubclassDataFromValue
- public getType
- public getUniqueUndroppableUser
- public getUniqueUndroppableUser
- public getValueID
- public getValueName
- protected hasMetadata
- protected hasMetadata
- protected hasMetadata
- public hasNUndroppableUses
- public hasNUndroppableUsesOrMore
- public hasNUses
- public hasNUsesOrMore
- public hasName
- public hasOneUse
- public hasOneUser
- public hasSameSubclassOptionalData
- public hasValueHandle
- public isSwiftError
- public isTransitiveUsedByMetadataOnly
- 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
- protected setMetadata
- protected setMetadata
- 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 stripPointerCastsForAliasAnalysis
- public stripPointerCastsForAliasAnalysis
- 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:37
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:159
Parameters
- llvm::Attribute Attr
¶void addAttr(Attribute::AttrKind Kind)
void addAttr(Attribute::AttrKind Kind)
Declared at: llvm/include/llvm/IR/Argument.h:157
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:155
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:172
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:46
¶llvm::Attribute getAttribute(
Attribute::AttrKind Kind) const
llvm::Attribute getAttribute(
Attribute::AttrKind Kind) const
Declared at: llvm/include/llvm/IR/Argument.h:169
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:60
¶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:64
¶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:102
¶uint64_t getParamAlignment() const
uint64_t 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:99
¶llvm::Type* getParamByRefType() const
llvm::Type* getParamByRefType() const
Description
If this is a byref argument, return its type.
Declared at: llvm/include/llvm/IR/Argument.h:113
¶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:107
¶llvm::Type* getParamInAllocaType() const
llvm::Type* getParamInAllocaType() const
Description
If this is an inalloca argument, return its type.
Declared at: llvm/include/llvm/IR/Argument.h:116
¶llvm::MaybeAlign getParamStackAlign() const
llvm::MaybeAlign getParamStackAlign() const
Declared at: llvm/include/llvm/IR/Argument.h:104
¶llvm::Type* getParamStructRetType() const
llvm::Type* getParamStructRetType() const
Description
If this is an sret argument, return its type.
Declared at: llvm/include/llvm/IR/Argument.h:110
¶inline const llvm::Function* getParent() const
inline const llvm::Function* getParent() const
Declared at: llvm/include/llvm/IR/Argument.h:40
¶inline llvm::Function* getParent()
inline llvm::Function* getParent()
Declared at: llvm/include/llvm/IR/Argument.h:41
¶uint64_t getPassPointeeByValueCopySize(
const llvm::DataLayout& DL) const
uint64_t getPassPointeeByValueCopySize(
const llvm::DataLayout& DL) const
Description
If this argument satisfies has hasPassPointeeByValueAttr, return the in-memory ABI size copied to the stack for the call. Otherwise, return 0.
Declared at: llvm/include/llvm/IR/Argument.h:85
Parameters
- const llvm::DataLayout& DL
¶llvm::Type* getPointeeInMemoryValueType() const
llvm::Type* getPointeeInMemoryValueType() const
Description
If hasPointeeInMemoryValueAttr returns true, the in-memory ABI type is returned. Otherwise, nullptr.
Declared at: llvm/include/llvm/IR/Argument.h:94
¶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:167
Parameters
- Attribute::AttrKind Kind
¶bool hasByRefAttr() const
bool hasByRefAttr() const
Description
Return true if this argument has the byref attribute.
Declared at: llvm/include/llvm/IR/Argument.h:70
¶bool hasByValAttr() const
bool hasByValAttr() const
Description
Return true if this argument has the byval attribute.
Declared at: llvm/include/llvm/IR/Argument.h:67
¶bool hasInAllocaAttr() const
bool hasInAllocaAttr() const
Description
Return true if this argument has the inalloca attribute.
Declared at: llvm/include/llvm/IR/Argument.h:143
¶bool hasInRegAttr() const
bool hasInRegAttr() const
Description
Return true if this argument has the inreg attribute.
Declared at: llvm/include/llvm/IR/Argument.h:134
¶bool hasNestAttr() const
bool hasNestAttr() const
Description
Return true if this argument has the nest attribute.
Declared at: llvm/include/llvm/IR/Argument.h:119
¶bool hasNoAliasAttr() const
bool hasNoAliasAttr() const
Description
Return true if this argument has the noalias attribute.
Declared at: llvm/include/llvm/IR/Argument.h:122
¶bool hasNoCaptureAttr() const
bool hasNoCaptureAttr() const
Description
Return true if this argument has the nocapture attribute.
Declared at: llvm/include/llvm/IR/Argument.h:125
¶bool hasNoFreeAttr() const
bool hasNoFreeAttr() const
Description
Return true if this argument has the nofree attribute.
Declared at: llvm/include/llvm/IR/Argument.h:128
¶bool hasNonNullAttr(
bool AllowUndefOrPoison = true) const
bool hasNonNullAttr(
bool AllowUndefOrPoison = true) 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). If AllowUndefOrPoison is true, respect the semantics of nonnull attribute and return true even if the argument can be undef or poison.
Declared at: llvm/include/llvm/IR/Argument.h:56
Parameters
- bool AllowUndefOrPoison = true
¶bool hasPassPointeeByValueCopyAttr() const
bool hasPassPointeeByValueCopyAttr() const
Description
Return true if this argument has the byval, inalloca, or preallocated attribute. These attributes represent arguments being passed by value, with an associated copy between the caller and callee
Declared at: llvm/include/llvm/IR/Argument.h:81
¶bool hasPointeeInMemoryValueAttr() const
bool hasPointeeInMemoryValueAttr() const
Description
Return true if this argument has the byval, sret, inalloca, preallocated, or byref attribute. These attributes represent arguments being passed by value (which may or may not involve a stack copy)
Declared at: llvm/include/llvm/IR/Argument.h:90
¶bool hasPreallocatedAttr() const
bool hasPreallocatedAttr() const
Description
Return true if this argument has the preallocated attribute.
Declared at: llvm/include/llvm/IR/Argument.h:146
¶bool hasReturnedAttr() const
bool hasReturnedAttr() const
Description
Return true if this argument has the returned attribute.
Declared at: llvm/include/llvm/IR/Argument.h:137
¶bool hasSExtAttr() const
bool hasSExtAttr() const
Description
Return true if this argument has the sext attribute.
Declared at: llvm/include/llvm/IR/Argument.h:152
¶bool hasStructRetAttr() const
bool hasStructRetAttr() const
Description
Return true if this argument has the sret attribute.
Declared at: llvm/include/llvm/IR/Argument.h:131
¶bool hasSwiftErrorAttr() const
bool hasSwiftErrorAttr() const
Description
Return true if this argument has the swifterror attribute.
Declared at: llvm/include/llvm/IR/Argument.h:76
¶bool hasSwiftSelfAttr() const
bool hasSwiftSelfAttr() const
Description
Return true if this argument has the swiftself attribute.
Declared at: llvm/include/llvm/IR/Argument.h:73
¶bool hasZExtAttr() const
bool hasZExtAttr() const
Description
Return true if this argument has the zext attribute.
Declared at: llvm/include/llvm/IR/Argument.h:149
¶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:140
¶void removeAttr(Attribute::AttrKind Kind)
void removeAttr(Attribute::AttrKind Kind)
Description
Remove attributes from an argument.
Declared at: llvm/include/llvm/IR/Argument.h:162
Parameters
- Attribute::AttrKind Kind
¶void removeAttrs(const llvm::AttributeMask& AM)
void removeAttrs(const llvm::AttributeMask& AM)
Declared at: llvm/include/llvm/IR/Argument.h:164
Parameters
- const llvm::AttributeMask& AM
¶void setParent(llvm::Function* parent)
void setParent(llvm::Function* parent)
Declared at: llvm/include/llvm/IR/Argument.h:33
Parameters
- llvm::Function* parent