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

Inherited from Value:

Methods

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)

Declared at: llvm/include/llvm/IR/Argument.h:159

Parameters

llvm::Attribute Attr

void addAttr(Attribute::AttrKind Kind)

Declared at: llvm/include/llvm/IR/Argument.h:157

Parameters

Attribute::AttrKind Kind

void addAttrs(llvm::AttrBuilder& B)

Description

Add attributes to an argument.

Declared at: llvm/include/llvm/IR/Argument.h:155

Parameters

llvm::AttrBuilder& B

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

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

Declared at: llvm/include/llvm/IR/Argument.h:169

Parameters

Attribute::AttrKind Kind

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

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

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

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

Description

If this is a byref argument, return its type.

Declared at: llvm/include/llvm/IR/Argument.h:113

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

Description

If this is an inalloca argument, return its type.

Declared at: llvm/include/llvm/IR/Argument.h:116

llvm::MaybeAlign getParamStackAlign() const

Declared at: llvm/include/llvm/IR/Argument.h:104

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

Declared at: llvm/include/llvm/IR/Argument.h:40

inline llvm::Function* getParent()

Declared at: llvm/include/llvm/IR/Argument.h:41

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

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

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

Description

Return true if this argument has the byref attribute.

Declared at: llvm/include/llvm/IR/Argument.h:70

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

Description

Return true if this argument has the inalloca attribute.

Declared at: llvm/include/llvm/IR/Argument.h:143

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

Description

Return true if this argument has the nest attribute.

Declared at: llvm/include/llvm/IR/Argument.h:119

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

Description

Return true if this argument has the nocapture attribute.

Declared at: llvm/include/llvm/IR/Argument.h:125

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

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

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

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

Description

Return true if this argument has the preallocated attribute.

Declared at: llvm/include/llvm/IR/Argument.h:146

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

Description

Return true if this argument has the sext attribute.

Declared at: llvm/include/llvm/IR/Argument.h:152

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

Description

Return true if this argument has the swifterror attribute.

Declared at: llvm/include/llvm/IR/Argument.h:76

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

Description

Return true if this argument has the zext attribute.

Declared at: llvm/include/llvm/IR/Argument.h:149

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)

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)

Declared at: llvm/include/llvm/IR/Argument.h:164

Parameters

const llvm::AttributeMask& AM

void setParent(llvm::Function* parent)

Declared at: llvm/include/llvm/IR/Argument.h:33

Parameters

llvm::Function* parent