LLVM API Documentation

llvm::Argument Class Reference

LLVM Argument representation. More...

#include <Argument.h>

Inheritance diagram for llvm::Argument:

Inheritance graph
[legend]
Collaboration diagram for llvm::Argument:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Argument (const Type *Ty, const std::string &Name="", Function *F=0)
const FunctiongetParent () const
FunctiongetParent ()
unsigned getArgNo () const
bool hasByValAttr () const
bool hasNoAliasAttr () const
bool hasStructRetAttr () const
void addAttr (Attributes)
 addAttr - Add a Attribute to an argument
void removeAttr (Attributes)
 removeAttr - Remove a Attribute from an argument

Static Public Member Functions

static bool classof (const Argument *)
static bool classof (const Value *V)

Friends

class SymbolTableListTraits< Argument, Function >


Detailed Description

LLVM Argument representation.

A class to represent an incoming formal argument to a Function. An argument is a very simple Value. It is essentially a named (optional) type. When used in the body of a function, it represents the value of the actual argument the function was called with.

Definition at line 31 of file Argument.h.


Constructor & Destructor Documentation

Argument::Argument ( const Type Ty,
const std::string &  Name = "",
Function F = 0 
) [explicit]

Argument ctor - If Function argument is specified, this argument is inserted at the end of the argument list for the function.

Definition at line 57 of file Function.cpp.

References llvm::LeakDetector::addGarbageObject(), llvm::Function::getArgumentList(), and llvm::Value::setName().


Member Function Documentation

const Function* llvm::Argument::getParent (  )  const [inline]

Function* llvm::Argument::getParent (  )  [inline]

Definition at line 45 of file Argument.h.

unsigned Argument::getArgNo (  )  const

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.

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 79 of file Function.cpp.

References AI, llvm::Function::arg_begin(), and getParent().

Referenced by addAttr(), hasByValAttr(), hasNoAliasAttr(), and removeAttr().

bool Argument::hasByValAttr (  )  const

hasByValAttr - 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 93 of file Function.cpp.

References llvm::Attribute::ByVal, getArgNo(), getParent(), llvm::Value::getType(), and llvm::Function::paramHasAttr().

Referenced by isOnlyUsedInEntryBlock().

bool Argument::hasNoAliasAttr (  )  const

hasNoAliasAttr - 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 100 of file Function.cpp.

References getArgNo(), getParent(), llvm::Value::getType(), llvm::Attribute::NoAlias, and llvm::Function::paramHasAttr().

bool Argument::hasStructRetAttr (  )  const

hasSRetAttr - 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 107 of file Function.cpp.

References getParent(), llvm::Value::getType(), llvm::Function::paramHasAttr(), and llvm::Attribute::StructRet.

void Argument::addAttr ( Attributes  attr  ) 

addAttr - Add a Attribute to an argument

Definition at line 115 of file Function.cpp.

References llvm::Function::addAttribute(), getArgNo(), and getParent().

void Argument::removeAttr ( Attributes  attr  ) 

removeAttr - Remove a Attribute from an argument

Definition at line 120 of file Function.cpp.

References getArgNo(), getParent(), and llvm::Function::removeAttribute().

static bool llvm::Argument::classof ( const Argument  )  [inline, static]

classof - Methods for support type inquiry through isa, cast, and dyn_cast:

Definition at line 72 of file Argument.h.

static bool llvm::Argument::classof ( const Value V  )  [inline, static]

Reimplemented from llvm::Value.

Definition at line 73 of file Argument.h.

References llvm::Value::ArgumentVal, and llvm::Value::getValueID().


Friends And Related Function Documentation

friend class SymbolTableListTraits< Argument, Function > [friend]

Definition at line 34 of file Argument.h.


The documentation for this class was generated from the following files:



This web site is hosted by the Computer Science Department at the University of Illinois at Urbana-Champaign.