Helper to describe and deal with positions in the LLVM‐IR.

Synopsis

Declared in <llvm/Transforms/IPO/Attributor.h>

struct IRPosition;

Description

A position in the IR is described by an anchor value and an "offset" that could be the argument number, for call sites and arguments, or an indicator of the "position kind". The kinds, specified in the Kind enum below, include the locations in the attribute list, i.a., function scope and return value, as well as a distinction between call sites and functions. Finally, there are floating values that do not have a corresponding attribute list position.

Type Aliases

Name

Description

CallBaseContext

Call‐base context associated with an IR position.

Enums

Name

Description

Kind

The positions we distinguish in the IR.

Member Functions

Name

Description

IRPosition [constructor]

Construct an invalid IR position.

getAnchorScope

Return the Function surrounding the anchor value.

getAnchorValue

Return the value this abstract attribute is anchored with.

getArg

Return theargument ArgNo associated with this function or call site scope.

getAssociatedArgument

Return the associated argument, if any.

getAssociatedFunction

Return the associated function, if any.

getAssociatedType

Return the type this abstract attribute is associated with.

getAssociatedValue

Return the value this abstract attribute is associated with.

getAttrIdx

Return the index in the attribute list for this position.

getAttrList

Return the attributes associated with this function or call site scope.

getAttrListAnchor

Return the value attributes are attached to.

getCallBaseContext

Get the call base context from the position.

getCallSiteArgNo

Return the call‐site argument number of the associated value.

getCalleeArgNo

Return the callee‐side argument number, or a negative value.

getCtxI

Return the context instruction, if any.

getNumArgs

Return the number of arguments associated with this function or call site scope.

getPositionKind

Return the associated position kind.

hasCallBaseContext

Check if the position has any call base context.

isAnyCallSitePosition

Return true if this is any call‐site‐related position.

isArgumentPosition

Return true if the position is an argument or call site argument.

isFnInterfaceKind

Return true if the position refers to a function interface, that is the function scope, the function return, or an argument.

isFunctionScope

Return true if this is a function or call site position.

setAttrList

Update the attributes associated with this function or call site scope.

stripCallBaseContext

Return the same position without the call base context.

operator void*

Conversion into a void * to allow reuse of pointer hashing.

operator==

Return true if this equals RHS.

operator!=

Return true if this differs from RHS.

Static Member Functions

Name

Description

argument

Create a position describing the argument Arg.

callsite_argument

callsite_argument overloads

callsite_function

Create a position describing the function scope of CB.

callsite_returned

Create a position describing the returned value of CB.

function

Create a position describing the function scope of F.

function_scope

Create a function‐scope position matching the context of IRP.

inst

Create a position describing the instruction I.

returned

Create a position describing the returned value of F.

value

Create a position describing the value of V.

Derived Classes

Name

Description

AbstractAttribute

Base struct for all "concrete attribute" deductions.

Created with MrDocs