12 : cgm(genModule), astContext(genModule.getASTContext()),
13 builder(cgm.getBuilder()) {}
18 return *builder.getContext();
26 TypeCacheTy::iterator tci =
typeCache.find(ty);
33 mlir::Type resultType =
nullptr;
36 switch (cast<BuiltinType>(ty)->
getKind()) {
38 case BuiltinType::Char_S:
39 case BuiltinType::Int:
40 case BuiltinType::Int128:
41 case BuiltinType::Long:
42 case BuiltinType::LongLong:
43 case BuiltinType::SChar:
44 case BuiltinType::Short:
45 case BuiltinType::WChar_S:
51 case BuiltinType::Char8:
52 case BuiltinType::Char16:
53 case BuiltinType::Char32:
54 case BuiltinType::Char_U:
55 case BuiltinType::UChar:
56 case BuiltinType::UInt:
57 case BuiltinType::UInt128:
58 case BuiltinType::ULong:
59 case BuiltinType::ULongLong:
60 case BuiltinType::UShort:
61 case BuiltinType::WChar_U:
74 const auto *bitIntTy = cast<BitIntType>(
type);
75 if (bitIntTy->getNumBits() > cir::IntType::maxBitwidth()) {
79 resultType = cir::IntType::get(&
getMLIRContext(), bitIntTy->getNumBits(),
80 bitIntTy->isSigned());
90 assert(resultType &&
"Type conversion not yet implemented");
Defines the clang::ASTContext interface.
static Decl::Kind getKind(const Decl *D)
C Language Family Type Representation.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
uint64_t getTypeSize(QualType T) const
Return the size of the specified (complete) type T, in bits.
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.
CIRGenTypes(CIRGenModule &cgm)
mlir::MLIRContext & getMLIRContext() const
mlir::Type convertType(clang::QualType type)
Convert a Clang type into a mlir::Type.
A (possibly-)qualified type.
Encodes a location in the source.
The base class of the type hierarchy.
TypeClass getTypeClass() const
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
The JSON file list parser is used to communicate input to InstallAPI.