15#ifndef LLVM_CLANG_CIR_CIRGENFUNCTIONINFO_H
16#define LLVM_CLANG_CIR_CIRGENFUNCTIONINFO_H
22#include "llvm/ADT/FoldingSet.h"
23#include "llvm/Support/TrailingObjects.h"
32 return llvm::count_if(
35 return info.hasPassObjectSize();
50 explicit RequiredArgs(
unsigned n) : numRequired(n) { assert(n != ~0
U); }
62 unsigned additional) {
73 unsigned additional) {
85class CIRGenFunctionInfo final
86 :
public llvm::FoldingSetNode,
87 private llvm::TrailingObjects<CIRGenFunctionInfo, CanQualType> {
89 unsigned callingConvention : 8;
92 unsigned astCallingConvention : 8;
95 LLVM_PREFERRED_TYPE(
bool)
96 unsigned noReturn : 1;
100 LLVM_PREFERRED_TYPE(
bool)
101 unsigned instanceMethod : 1;
107 CanQualType *getArgTypes() {
return getTrailingObjects(); }
108 const CanQualType *getArgTypes()
const {
return getTrailingObjects(); }
123 static CIRGenFunctionInfo *
create(cir::CallingConv cirCC,
129 void operator delete(
void *p) { ::operator
delete(p); }
140 static void Profile(llvm::FoldingSetNodeID &
id,
bool instanceMethod,
144 id.AddInteger(info.getCC());
145 id.AddBoolean(instanceMethod);
146 id.AddBoolean(info.getNoReturn());
147 id.AddInteger(required.getOpaqueData());
195 bool isVariadic()
const {
return required.allowsOptionalArgs(); }
206 return static_cast<cir::CallingConv
>(callingConvention);
210 return static_cast<CallingConv>(astCallingConvention);
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
CallingConv getASTCallingConvention() const
unsigned getNumRequiredArgs() const
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 CIRGenFunctionInfo * create(cir::CallingConv cirCC, FunctionType::ExtInfo info, bool instanceMethod, CanQualType resultType, llvm::ArrayRef< CanQualType > argTypes, RequiredArgs required)
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
cir::CallingConv getCallingConvention() 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.
ArrayRef< ExtParameterInfo > getExtParameterInfos() const
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.
Interesting information about a specific parameter that can't simply be reflected in parameter's type...
unsigned getNumPassObjectSizeParams(const clang::FunctionProtoType *proto)
Return the number of parameters with the pass_object_size attribute.
CanQual< Type > CanQualType
Represents a canonical, potentially-qualified type.
CallingConv
CallingConv - Specifies the calling convention that a function uses.