AbstractCallSite
Declared in <llvm/IR/AbstractCallSite.h>
class AbstractCallSite;
An abstract call site is a wrapper that allows to treat direct, indirect, and callback calls the same. If an abstract call site represents a direct or indirect call site it behaves like a stripped down version of a normal call site object. The abstract call site can also represent a callback call, thus the fact that the initially called function (=broker) may invoke a third one (=callback callee). In this case, the abstract call site hides the middle man, hence the broker function. The result is a representation of the callback call, inside the broker, but in the context of the original call to the broker.
There are up to three functions involved when we talk about callback call sites. The caller (1), which invokes the broker function. The broker function (2), that will invoke the callee zero or more times. And finally the callee (3), which is the target of the callback call.
The abstract call site will handle the mapping from parameters to arguments depending on the semantic of the broker function. However, it is important to note that the mapping is often partial. Thus, some arguments of the call/invoke instruction are mapped to parameters of the callee while others are not.
| Name | Description |
|---|---|
CallbackInfo | The encoding of a callback with regards to the underlying instruction. |
| Name | Description |
|---|---|
AbstractCallSite [constructor] | Sole constructor for abstract call sites (ACS). |
getCallArgOperand | getCallArgOperand overloads |
getCallArgOperandNo | getCallArgOperandNo overloads |
getCallArgOperandNoForCallee | Return the operand index of the underlying instruction associated with the callee of this ACS. Only valid for callback calls! |
getCalledFunction | Return the function being called if this is a direct call, otherwise return null (if it's an indirect call). |
getCalledOperand | Return the pointer to function that is being called. |
getCalleeUseForCallback | Return the use of the callee value in the underlying instruction. Only valid for callback calls! |
getInstruction | Return the underlying instruction. |
getNumArgOperands | Return the number of parameters of the callee. |
isCallbackCall | Return true if this ACS represents a callback call. |
isCallee | isCallee overloads |
isDirectCall | Return true if this ACS represents a direct call. |
isIndirectCall | Return true if this ACS represents an indirect call. |
operator bool | Conversion operator to conveniently check for a valid/initialized ACS. |
| Name | Description |
|---|---|
getCallbackUses | Add operand uses of CB that represent callback uses into CallbackUses. |