14#ifndef CLANG_LIB_CODEGEN_CIRGENCALL_H
15#define CLANG_LIB_CODEGEN_CIRGENCALL_H
18#include "mlir/IR/Operation.h"
20#include "llvm/ADT/SmallVector.h"
35 : calleeProtoTy(calleeProtoTy), calleeDecl(calleeDecl) {}
37 : calleeProtoTy(nullptr), calleeDecl(calleeDecl) {}
55 struct BuiltinInfoStorage {
59 struct PseudoDestructorInfoStorage {
62 struct VirtualInfoStorage {
69 SpecialKind kindOrFunctionPtr;
78 explicit CIRGenCallee(SpecialKind kind) : kindOrFunctionPtr(kind) {}
84 : kindOrFunctionPtr(SpecialKind(reinterpret_cast<
uintptr_t>(funcPtr))),
86 assert(funcPtr &&
"configuring callee without function pointer");
95 bool isBuiltin()
const {
return kindOrFunctionPtr == SpecialKind::Builtin; }
122 return kindOrFunctionPtr == SpecialKind::PseudoDestructor;
147 return reinterpret_cast<mlir::Operation *
>(kindOrFunctionPtr);
150 bool isVirtual()
const {
return kindOrFunctionPtr == SpecialKind::Virtual; }
185 kindOrFunctionPtr = SpecialKind(
reinterpret_cast<uintptr_t>(functionPtr));
203 [[maybe_unused]]
mutable bool isUsed;
217 assert(hasLV && !isUsed);
222 assert(!hasLV && !isUsed);
234 emplace_back(lvalue,
type);
241 insert(end(), other.begin(), other.end());
Abstract information about a function or function prototype.
CIRGenCalleeInfo(clang::GlobalDecl calleeDecl)
clang::GlobalDecl getCalleeDecl() const
CIRGenCalleeInfo(const clang::FunctionProtoType *calleeProtoTy, clang::GlobalDecl calleeDecl)
const clang::FunctionProtoType * getCalleeFunctionProtoType() const
bool isPseudoDestructor() const
void setFunctionPointer(mlir::Operation *functionPtr)
const clang::FunctionDecl * getBuiltinDecl() const
const CXXPseudoDestructorExpr * getPseudoDestructorExpr() const
static CIRGenCallee forDirect(mlir::Operation *funcPtr, const CIRGenCalleeInfo &abstractInfo=CIRGenCalleeInfo())
unsigned getBuiltinID() const
VirtualInfoStorage virtualInfo
CIRGenCalleeInfo getAbstractInfo() const
clang::GlobalDecl getVirtualMethodDecl() const
BuiltinInfoStorage builtinInfo
CIRGenCallee prepareConcreteCallee(CIRGenFunction &cgf) const
If this is a delayed callee computation of some sort, prepare a concrete callee.
Address getThisAddress() const
static CIRGenCallee forBuiltin(unsigned builtinID, const clang::FunctionDecl *builtinDecl)
cir::FuncType getVirtualFunctionType() const
CIRGenCallee(const CIRGenCalleeInfo &abstractInfo, mlir::Operation *funcPtr)
static CIRGenCallee forVirtual(const clang::CallExpr *ce, clang::GlobalDecl md, Address addr, cir::FuncType fTy)
CIRGenCalleeInfo abstractInfo
const clang::CallExpr * getVirtualCallExpr() const
mlir::Operation * getFunctionPointer() const
PseudoDestructorInfoStorage pseudoDestructorInfo
static CIRGenCallee forPseudoDestructor(const clang::CXXPseudoDestructorExpr *expr)
void addFrom(const CallArgList &other)
Add all the arguments from another CallArgList to this one.
void addUncopiedAggregate(LValue lvalue, clang::QualType type)
void add(RValue rvalue, clang::QualType type)
Type for representing both the decl and type of parameters to a function.
This trivial value class is used to represent the result of an expression that is evaluated.
Contains the address where the return value of a function can be stored, and whether the address is v...
ReturnValueSlot()=default
ReturnValueSlot(Address addr)
Represents a C++ pseudo-destructor (C++ [expr.pseudo]).
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Represents a function declaration or definition.
Represents a prototype with parameter type info, e.g.
GlobalDecl - represents a global declaration.
A (possibly-)qualified type.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const internal::VariadicAllOfMatcher< Decl > decl
Matches declarations.
const internal::VariadicDynCastAllOfMatcher< Stmt, Expr > expr
Matches expressions.
__UINTPTR_TYPE__ uintptr_t
An unsigned integer type with the property that any valid pointer to void can be converted to this ty...
static bool cleanupsToDeactivate()
CallArg(RValue rv, clang::QualType ty)
CallArg(LValue lv, clang::QualType ty)
RValue getKnownRValue() const
LValue getKnownLValue() const