;
15: cgm(genModule), astContext(genModule.getASTContext()),
16builder(cgm.getBuilder()) {}
21 return*builder.getContext();
39 return!
tagType->isIncompleteType();
51 if(
const auto*fpt = dyn_cast<FunctionProtoType>(ft))
52 for(
unsignedi = 0, e = fpt->getNumParams(); i != e; i++)
59mlir::Type CIRGenTypes::ConvertFunctionTypeInternal(
QualTypeqft) {
75 if(
const auto*fpt = dyn_cast<FunctionProtoType>(ft)) {
77 for(
unsignedi = 0; i < fpt->getNumParams(); ++i) {
78mlirParamTypes.push_back(
convertType(fpt->getParamType(i)));
80 returncir::FuncType::get(
81mlirParamTypes,
convertType(fpt->getReturnType().getUnqualifiedType()),
93TypeCacheTy::iterator tci =
typeCache.find(ty);
100mlir::Type resultType =
nullptr;
102 caseType::Builtin: {
103 switch(cast<BuiltinType>(ty)->
getKind()) {
106 caseBuiltinType::Void:
107resultType = cgm.
VoidTy;
111 caseBuiltinType::Char_S:
112 caseBuiltinType::Int:
113 caseBuiltinType::Int128:
114 caseBuiltinType::Long:
115 caseBuiltinType::LongLong:
116 caseBuiltinType::SChar:
117 caseBuiltinType::Short:
118 caseBuiltinType::WChar_S:
124 caseBuiltinType::Char8:
125 caseBuiltinType::Char16:
126 caseBuiltinType::Char32:
127 caseBuiltinType::Char_U:
128 caseBuiltinType::UChar:
129 caseBuiltinType::UInt:
130 caseBuiltinType::UInt128:
131 caseBuiltinType::ULong:
132 caseBuiltinType::ULongLong:
133 caseBuiltinType::UShort:
134 caseBuiltinType::WChar_U:
141 caseBuiltinType::Float16:
142resultType = cgm.
FP16Ty;
144 caseBuiltinType::Half:
147resultType = cgm.
FP16Ty;
153 caseBuiltinType::BFloat16:
156 caseBuiltinType::Float:
158&llvm::APFloat::IEEEsingle() &&
159 "ClangIR NYI: 'float' in a format other than IEEE 32-bit");
162 caseBuiltinType::Double:
164&llvm::APFloat::IEEEdouble() &&
165 "ClangIR NYI: 'double' in a format other than IEEE 64-bit");
168 caseBuiltinType::LongDouble:
172 caseBuiltinType::Float128:
175 caseBuiltinType::Ibm128:
188 caseType::Pointer: {
199 caseType::FunctionNoProto:
200 caseType::FunctionProto:
201resultType = ConvertFunctionTypeInternal(
type);
205 const auto*bitIntTy = cast<BitIntType>(
type);
206 if(bitIntTy->getNumBits() > cir::IntType::maxBitwidth()) {
210resultType = cir::IntType::get(&
getMLIRContext(), bitIntTy->getNumBits(),
211bitIntTy->isSigned());
222assert(resultType &&
"Type conversion not yet implemented");
Defines the clang::ASTContext interface.
static Decl::Kind getKind(const Decl *D)
C Language Family Type Representation.
cir::PointerType getPointerTo(mlir::Type ty)
const llvm::fltSemantics & getFloatTypeSemantics(QualType T) const
Return the APFloat 'semantics' for the specified scalar floating point type.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
const LangOptions & getLangOpts() const
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
const TargetInfo & getTargetInfo() const
cir::LongDoubleType getLongDoubleTy(const llvm::fltSemantics &format) const
This class organizes the cross-function state that is used while generating CIR code.
DiagnosticBuilder errorNYI(SourceLocation, llvm::StringRef)
Helpers to emit "not yet implemented" error diagnostics.
bool isFuncTypeConvertible(const clang::FunctionType *ft)
Utility to check whether a function type can be converted to a CIR type (i.e.
CIRGenTypes(CIRGenModule &cgm)
mlir::MLIRContext & getMLIRContext() const
bool isFuncParamTypeConvertible(clang::QualType type)
Return true if the specified type in a function parameter or result position can be converted to a CI...
mlir::Type convertType(clang::QualType type)
Convert a Clang type into a mlir::Type.
FunctionType - C99 6.7.5.3 - Function Declarators.
QualType getReturnType() const
A pointer to member type per C++ 8.3.3 - Pointers to members.
PointerType - C99 6.7.5.1 - Pointer Declarators.
QualType getPointeeType() const
A (possibly-)qualified type.
const Type * getTypePtr() const
Retrieves a pointer to the underlying (unqualified) type.
Encodes a location in the source.
virtual bool useFP16ConversionIntrinsics() const
Check whether llvm intrinsics such as llvm.convert.to.fp16 should be used to convert to and from __fp...
The base class of the type hierarchy.
bool isConstantMatrixType() const
TypeClass getTypeClass() const
Defines the clang::TargetInfo interface.
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
const AstTypeMatcher< TagType > tagType
Matches tag types (record and enum types).
The JSON file list parser is used to communicate input to InstallAPI.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4