LLVM  6.0.0svn
Functions

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

Collaboration diagram for Function Parameters:

Functions

unsigned LLVMCountParams (LLVMValueRef Fn)
 Obtain the number of parameters in a function. More...
 
void LLVMGetParams (LLVMValueRef Fn, LLVMValueRef *Params)
 Obtain the parameters in a function. More...
 
LLVMValueRef LLVMGetParam (LLVMValueRef Fn, unsigned Index)
 Obtain the parameter at the specified index. More...
 
LLVMValueRef LLVMGetParamParent (LLVMValueRef Inst)
 Obtain the function to which this argument belongs. More...
 
LLVMValueRef LLVMGetFirstParam (LLVMValueRef Fn)
 Obtain the first parameter to a function. More...
 
LLVMValueRef LLVMGetLastParam (LLVMValueRef Fn)
 Obtain the last parameter to a function. More...
 
LLVMValueRef LLVMGetNextParam (LLVMValueRef Arg)
 Obtain the next parameter to a function. More...
 
LLVMValueRef LLVMGetPreviousParam (LLVMValueRef Arg)
 Obtain the previous parameter to a function. More...
 
void LLVMSetParamAlignment (LLVMValueRef Arg, unsigned Align)
 Set the alignment for a function parameter. More...
 

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

◆ LLVMCountParams()

unsigned LLVMCountParams ( LLVMValueRef  Fn)

Obtain the number of parameters in a function.

See also
llvm::Function::arg_size()

Definition at line 1921 of file Core.cpp.

◆ LLVMGetFirstParam()

LLVMValueRef LLVMGetFirstParam ( LLVMValueRef  Fn)

Obtain the first parameter to a function.

See also
llvm::Function::arg_begin()

Definition at line 1943 of file Core.cpp.

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

◆ LLVMGetLastParam()

LLVMValueRef LLVMGetLastParam ( LLVMValueRef  Fn)

Obtain the last parameter to a function.

See also
llvm::Function::arg_end()

Definition at line 1951 of file Core.cpp.

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

◆ LLVMGetNextParam()

LLVMValueRef LLVMGetNextParam ( LLVMValueRef  Arg)

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 1959 of file Core.cpp.

References Arg, llvm::Argument::getArgNo(), llvm::Argument::getParent(), and llvm::wrap().

◆ LLVMGetParam()

LLVMValueRef LLVMGetParam ( LLVMValueRef  Fn,
unsigned  Index 
)

Obtain the parameter at the specified index.

Parameters are indexed from 0.

See also
llvm::Function::arg_begin()

Definition at line 1934 of file Core.cpp.

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

◆ LLVMGetParamParent()

LLVMValueRef LLVMGetParamParent ( LLVMValueRef  Inst)

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 1939 of file Core.cpp.

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

◆ LLVMGetParams()

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 1927 of file Core.cpp.

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

◆ LLVMGetPreviousParam()

LLVMValueRef LLVMGetPreviousParam ( LLVMValueRef  Arg)

Obtain the previous parameter to a function.

This is the opposite of LLVMGetNextParam().

Definition at line 1967 of file Core.cpp.

References Arg, llvm::Function::arg_begin(), llvm::Argument::getArgNo(), llvm::Argument::getParent(), and llvm::wrap().

◆ LLVMSetParamAlignment()

void LLVMSetParamAlignment ( LLVMValueRef  Arg,
unsigned  Align 
)

Set the alignment for a function parameter.

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

Definition at line 1974 of file Core.cpp.

References llvm::Argument::addAttr(), Arg, llvm::Value::getContext(), and llvm::Attribute::getWithAlignment().