LLVM 22.0.0git

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

Collaboration diagram for Function Parameters:

Functions

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

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()

LLVM_C_ABI unsigned LLVMCountParams ( LLVMValueRef Fn)

Obtain the number of parameters in a function.

See also
llvm::Function::arg_size()

Definition at line 2630 of file Core.cpp.

References llvm::unwrap().

◆ LLVMGetFirstParam()

LLVM_C_ABI LLVMValueRef LLVMGetFirstParam ( LLVMValueRef Fn)

Obtain the first parameter to a function.

See also
llvm::Function::arg_begin()

Definition at line 2651 of file Core.cpp.

References I, llvm::unwrap(), and llvm::wrap().

◆ LLVMGetLastParam()

LLVM_C_ABI LLVMValueRef LLVMGetLastParam ( LLVMValueRef Fn)

Obtain the last parameter to a function.

See also
llvm::Function::arg_end()

Definition at line 2659 of file Core.cpp.

References I, llvm::unwrap(), and llvm::wrap().

◆ LLVMGetNextParam()

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

References A(), llvm::Function::arg_begin(), llvm::Function::arg_size(), llvm::unwrap(), and llvm::wrap().

◆ LLVMGetParam()

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

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

◆ LLVMGetParamParent()

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

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

◆ LLVMGetParams()

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

References A(), llvm::Function::args(), llvm::unwrap(), and llvm::wrap().

◆ LLVMGetPreviousParam()

LLVM_C_ABI LLVMValueRef LLVMGetPreviousParam ( LLVMValueRef Arg)

Obtain the previous parameter to a function.

This is the opposite of LLVMGetNextParam().

Definition at line 2675 of file Core.cpp.

References A(), llvm::unwrap(), and llvm::wrap().

◆ LLVMSetParamAlignment()

LLVM_C_ABI void LLVMSetParamAlignment ( LLVMValueRef Arg,
unsigned Align )

Set the alignment for a function parameter.

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

Definition at line 2682 of file Core.cpp.

References A(), llvm::Attribute::getWithAlignment(), and llvm::unwrap().