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"
31 return llvm::count_if(
34 return info.hasPassObjectSize();
49 explicit RequiredArgs(
unsigned n) : numRequired(n) { assert(n != ~0
U); }
61 unsigned additional) {
72 unsigned additional) {
84class CIRGenFunctionInfo final
85 :
public llvm::FoldingSetNode,
86 private llvm::TrailingObjects<CIRGenFunctionInfo, CanQualType> {
88 LLVM_PREFERRED_TYPE(
bool)
89 unsigned noReturn : 1;
93 LLVM_PREFERRED_TYPE(
bool)
94 unsigned instanceMethod : 1;
100 CanQualType *getArgTypes() {
return getTrailingObjects(); }
101 const CanQualType *getArgTypes()
const {
return getTrailingObjects(); }
121 void operator delete(
void *p) { ::operator
delete(p); }
132 static void Profile(llvm::FoldingSetNodeID &
id,
bool instanceMethod,
136 id.AddBoolean(instanceMethod);
138 id.AddInteger(required.getOpaqueData());
186 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.
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.