15#ifndef LLVM_CLANG_CIR_CIRGENFUNCTIONINFO_H
16#define LLVM_CLANG_CIR_CIRGENFUNCTIONINFO_H
21#include "llvm/ADT/FoldingSet.h"
22#include "llvm/Support/TrailingObjects.h"
37 explicit RequiredArgs(
unsigned n) : numRequired(n) { assert(n != ~0
U); }
49 unsigned additional) {
54 llvm_unreachable(
"NYI");
61 unsigned additional) {
73class CIRGenFunctionInfo final
74 :
public llvm::FoldingSetNode,
75 private llvm::TrailingObjects<CIRGenFunctionInfo, CanQualType> {
77 LLVM_PREFERRED_TYPE(
bool)
78 unsigned noReturn : 1;
82 LLVM_PREFERRED_TYPE(
bool)
83 unsigned instanceMethod : 1;
89 CanQualType *getArgTypes() {
return getTrailingObjects(); }
90 const CanQualType *getArgTypes()
const {
return getTrailingObjects(); }
110 void operator delete(
void *p) { ::operator
delete(p); }
121 static void Profile(llvm::FoldingSetNodeID &
id,
bool instanceMethod,
125 id.AddBoolean(instanceMethod);
127 id.AddInteger(required.getOpaqueData());
175 bool isVariadic()
const {
return required.allowsOptionalArgs(); }
static ABIArgInfo getDirect(mlir::Type ty=nullptr)
arg_iterator argTypesEnd()
const CanQualType * const_arg_iterator
CanQualType getReturnType() const
const_arg_iterator argTypesEnd() const
cir::ABIArgInfo getReturnInfo() const
llvm::ArrayRef< CanQualType > argTypes() const
unsigned getNumRequiredArgs() const
static CIRGenFunctionInfo * create(FunctionType::ExtInfo info, bool instanceMethod, CanQualType resultType, llvm::ArrayRef< CanQualType > argTypes, RequiredArgs required)
void Profile(llvm::FoldingSetNodeID &id)
RequiredArgs getRequiredArgs() const
llvm::MutableArrayRef< CanQualType > argTypes()
llvm::ArrayRef< CanQualType > requiredArguments() const
arg_iterator argTypesBegin()
friend class TrailingObjects
CanQualType * arg_iterator
static void Profile(llvm::FoldingSetNodeID &id, bool instanceMethod, FunctionType::ExtInfo info, RequiredArgs required, CanQualType resultType, llvm::ArrayRef< CanQualType > argTypes)
bool isInstanceMethod() const
llvm::ArrayRef< CanQualType > arguments() const
const_arg_iterator argTypesBegin() const
unsigned argTypeSize() const
A class for recording the number of arguments that a function signature requires.
unsigned getNumRequiredArgs() const
unsigned getOpaqueData() const
static RequiredArgs getFromProtoWithExtraSlots(clang::CanQual< clang::FunctionProtoType > prototype, unsigned additional)
static RequiredArgs getFromProtoWithExtraSlots(const clang::FunctionProtoType *prototype, unsigned additional)
Compute the arguments required by the given formal prototype, given that there may be some additional...
bool allowsOptionalArgs() const
Represents a canonical, potentially-qualified type.
void Profile(llvm::FoldingSetNodeID &ID) const
const T * getTypePtr() const
Retrieve the underlying type pointer, which refers to a canonical type.
Represents a prototype with parameter type info, e.g.
unsigned getNumParams() const
bool isVariadic() const
Whether this function prototype is variadic.
bool hasExtParameterInfos() const
Is there any interesting extra information for any of the parameters of this function type?
A class which abstracts out some details necessary for making a call.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
CallingConv
CallingConv - Specifies the calling convention that a function uses.