14#ifndef LLVM_IR_ABSTRACTCALLSITE_H
15#define LLVM_IR_ABSTRACTCALLSITE_H
109 explicit operator bool()
const {
return CB !=
nullptr; }
142 "Callback without parameter encoding!");
146 if (
auto *CE = dyn_cast<ConstantExpr>(U->getUser()))
147 if (CE->hasOneUse() && CE->isCast())
148 U = &*CE->use_begin();
204 assert(CalleeArgIdx >= 0 &&
220 return V ? dyn_cast<Function>(V->stripPointerCasts()) :
nullptr;
225template <
typename UnaryFunction>
229 for (
const Use *U : CallbackUses) {
237template <
typename UnaryFunction>
This file contains the declarations for the subclasses of Constant, which represent the different fla...
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
int getCallArgOperandNoForCallee() const
Return the operand index of the underlying instruction associated with the callee of this ACS.
bool isCallee(const Use *U) const
Return true if U is the use that defines the callee of this ACS.
CallBase * getInstruction() const
Return the underlying instruction.
bool isCallbackCall() const
Return true if this ACS represents a callback call.
bool isDirectCall() const
Return true if this ACS represents a direct call.
bool isIndirectCall() const
Return true if this ACS represents an indirect call.
const Use & getCalleeUseForCallback() const
Return the use of the callee value in the underlying instruction.
static void getCallbackUses(const CallBase &CB, SmallVectorImpl< const Use * > &CallbackUses)
Add operand uses of CB that represent callback uses into CallbackUses.
int getCallArgOperandNo(unsigned ArgNo) const
Return the operand index of the underlying instruction associated with the function parameter number ...
bool isCallee(Value::const_user_iterator UI) const
Return true if UI is the use that defines the callee of this ACS.
Value * getCallArgOperand(Argument &Arg) const
Return the operand of the underlying instruction associated with Arg.
Value * getCallArgOperand(unsigned ArgNo) const
Return the operand of the underlying instruction associated with the function parameter number ArgNo ...
int getCallArgOperandNo(Argument &Arg) const
Return the operand index of the underlying instruction associated with Arg.
Value * getCalledOperand() const
Return the pointer to function that is being called.
unsigned getNumArgOperands() const
Return the number of parameters of the callee.
Function * getCalledFunction() const
Return the function being called if this is a direct call, otherwise return null (if it's an indirect...
This class represents an incoming formal argument to a Function.
unsigned getArgNo() const
Return the index of this formal argument in its containing function.
Base class for all callable instructions (InvokeInst and CallInst) Holds everything related to callin...
bool isIndirectCall() const
Return true if the callsite is an indirect call.
bool isCallee(Value::const_user_iterator UI) const
Determine whether the passed iterator points to the callee operand's Use.
Value * getCalledOperand() const
Value * getArgOperand(unsigned i) const
unsigned getArgOperandNo(const Use *U) const
Given a use for a arg operand, get the arg operand number that corresponds to it.
unsigned arg_size() const
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
A Use represents the edge between a Value definition and its users.
const Use & getOperandUse(unsigned i) const
LLVM Value Representation.
user_iterator_impl< const User > const_user_iterator
NodeAddr< UseNode * > Use
This is an optimization pass for GlobalISel generic memory operations.
void forEachCallbackCallSite(const CallBase &CB, UnaryFunction Func)
Apply function Func to each CB's callback call site.
void forEachCallbackFunction(const CallBase &CB, UnaryFunction Func)
Apply function Func to each CB's callback function.
The encoding of a callback with regards to the underlying instruction.
ParameterEncodingTy ParameterEncoding