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

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:38

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:124

Parameters

llvm::Attribute Attr

void addAttr(Attribute::AttrKind Kind)

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

Parameters

Attribute::AttrKind Kind

void addAttrs(llvm::AttrBuilder& B)

Description

Add attributes to an argument.

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

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:135

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:47

llvm::Attribute getAttribute(
    Attribute::AttrKind Kind) const

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

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:59

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

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

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

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

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

inline llvm::Function* getParent()

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

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

Description

Return true if this argument has the byval attribute.

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

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

Description

Return true if this argument has the inalloca attribute.

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

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

Description

Return true if this argument has the nest attribute.

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

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

Description

Return true if this argument has the nocapture attribute.

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

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

Description

Return true if this argument has the returned attribute.

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

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

Description

Return true if this argument has the sret attribute.

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

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

Description

Return true if this argument has the swiftself attribute.

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

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

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)

Description

Remove attributes from an argument.

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

Parameters

Attribute::AttrKind Kind