LLVM API Documentation

Functions
Function Parameters
Function values
Collaboration diagram for Function Parameters:

Functions

unsigned LLVMCountParams (LLVMValueRef Fn)
void LLVMGetParams (LLVMValueRef Fn, LLVMValueRef *Params)
LLVMValueRef LLVMGetParam (LLVMValueRef Fn, unsigned Index)
LLVMValueRef LLVMGetParamParent (LLVMValueRef Inst)
LLVMValueRef LLVMGetFirstParam (LLVMValueRef Fn)
LLVMValueRef LLVMGetLastParam (LLVMValueRef Fn)
LLVMValueRef LLVMGetNextParam (LLVMValueRef Arg)
LLVMValueRef LLVMGetPreviousParam (LLVMValueRef Arg)
void LLVMAddAttribute (LLVMValueRef Arg, LLVMAttribute PA)
void LLVMRemoveAttribute (LLVMValueRef Arg, LLVMAttribute PA)
LLVMAttribute LLVMGetAttribute (LLVMValueRef Arg)
void LLVMSetParamAlignment (LLVMValueRef Arg, unsigned align)

Detailed Description

Functions in this group relate to arguments/parameters on functions.

Functions in this group expect LLVMValueRef instances that correspond to llvm::Function instances.


Function Documentation

Add an attribute to a function argument.

See also:
llvm::Argument::addAttr()

Definition at line 1661 of file Core.cpp.

References llvm::ARM_PROC::A, llvm::Argument::addAttr(), llvm::Argument::getArgNo(), and llvm::Value::getContext().

Obtain the number of parameters in a function.

See also:
llvm::Function::arg_size()

Definition at line 1605 of file Core.cpp.

Get an attribute from a function argument.

Definition at line 1673 of file Core.cpp.

References llvm::ARM_PROC::A, llvm::Argument::getArgNo(), llvm::Function::getAttributes(), and llvm::Argument::getParent().

Obtain the first parameter to a function.

See also:
llvm::Function::arg_begin()

Definition at line 1629 of file Core.cpp.

References llvm::Function::arg_begin(), llvm::Function::arg_end(), I, and llvm::wrap().

Obtain the last parameter to a function.

See also:
llvm::Function::arg_end()

Definition at line 1637 of file Core.cpp.

References llvm::Function::arg_begin(), llvm::Function::arg_end(), I, and llvm::wrap().

Obtain the next parameter to a function.

This takes an LLVMValueRef obtained from LLVMGetFirstParam() (which is actually a wrapped iterator) and obtains the next parameter from the underlying iterator.

Definition at line 1645 of file Core.cpp.

References llvm::ARM_PROC::A, llvm::Function::arg_end(), llvm::Argument::getParent(), I, and llvm::wrap().

Obtain the parameter at the specified index.

Parameters are indexed from 0.

See also:
llvm::Function::arg_begin()

Definition at line 1618 of file Core.cpp.

References llvm::wrap().

Obtain the function to which this argument belongs.

Unlike other functions in this group, this one takes an LLVMValueRef that corresponds to a llvm::Attribute.

The returned LLVMValueRef is the llvm::Function to which this argument belongs.

Definition at line 1625 of file Core.cpp.

References getParent(), and llvm::wrap().

void LLVMGetParams ( LLVMValueRef  Fn,
LLVMValueRef Params 
)

Obtain the parameters in a function.

The takes a pointer to a pre-allocated array of LLVMValueRef that is at least LLVMCountParams() long. This array will be filled with LLVMValueRef instances which correspond to the parameters the function receives. Each LLVMValueRef corresponds to a llvm::Argument instance.

See also:
llvm::Function::arg_begin()

Definition at line 1611 of file Core.cpp.

References llvm::Function::arg_begin(), llvm::Function::arg_end(), I, and llvm::wrap().

Obtain the previous parameter to a function.

This is the opposite of LLVMGetNextParam().

Definition at line 1653 of file Core.cpp.

References llvm::ARM_PROC::A, llvm::Function::arg_begin(), llvm::Argument::getParent(), I, and llvm::wrap().

Remove an attribute from a function argument.

See also:
llvm::Argument::removeAttr()

Definition at line 1667 of file Core.cpp.

References llvm::ARM_PROC::A, llvm::Argument::getArgNo(), llvm::Value::getContext(), and llvm::Argument::removeAttr().

void LLVMSetParamAlignment ( LLVMValueRef  Arg,
unsigned  align 
)