clang 20.0.0git
|
This class organizes the cross-module state that is used while lowering AST types to CIR types. More...
#include "/home/buildbot/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenTypes.h"
Public Types | |
using | TypeCacheTy = llvm::DenseMap< const clang::Type *, mlir::Type > |
This map of clang::Type to mlir::Type (which includes CIR type) is a cache of types that have already been processed. | |
Public Member Functions | |
CIRGenTypes (CIRGenModule &cgm) | |
~CIRGenTypes () | |
bool | isFuncTypeConvertible (const clang::FunctionType *ft) |
Utility to check whether a function type can be converted to a CIR type (i.e. | |
bool | isFuncParamTypeConvertible (clang::QualType type) |
Return true if the specified type in a function parameter or result position can be converted to a CIR type at this point. | |
mlir::MLIRContext & | getMLIRContext () const |
mlir::Type | convertType (clang::QualType type) |
Convert a Clang type into a mlir::Type. | |
Public Attributes | |
TypeCacheTy | typeCache |
This class organizes the cross-module state that is used while lowering AST types to CIR types.
Definition at line 38 of file CIRGenTypes.h.
using clang::CIRGen::CIRGenTypes::TypeCacheTy = llvm::DenseMap<const clang::Type *, mlir::Type> |
This map of clang::Type to mlir::Type (which includes CIR type) is a cache of types that have already been processed.
Definition at line 57 of file CIRGenTypes.h.
CIRGenTypes::CIRGenTypes | ( | CIRGenModule & | cgm | ) |
Definition at line 14 of file CIRGenTypes.cpp.
CIRGenTypes::~CIRGenTypes | ( | ) |
Definition at line 18 of file CIRGenTypes.cpp.
mlir::Type CIRGenTypes::convertType | ( | clang::QualType | type | ) |
Convert a Clang type into a mlir::Type.
Definition at line 88 of file CIRGenTypes.cpp.
References clang::CIRGen::CIRGenTypeCache::BFloat16Ty, convertType(), clang::CIRGen::CIRGenTypeCache::DoubleTy, clang::CIRGen::CIRGenModule::errorNYI(), clang::CIRGen::CIRGenTypeCache::FloatTy, clang::CIRGen::CIRGenTypeCache::FP128Ty, clang::CIRGen::CIRGenTypeCache::FP16Ty, clang::ASTContext::getCanonicalType(), clang::ASTContext::getFloatTypeSemantics(), getKind(), clang::ASTContext::getLangOpts(), clang::CIRGen::CIRGenBuilderTy::getLongDoubleTy(), getMLIRContext(), clang::PointerType::getPointeeType(), cir::CIRBaseBuilderTy::getPointerTo(), clang::ASTContext::getTargetInfo(), clang::Type::getTypeClass(), clang::ASTContext::getTypeSize(), clang::Type::isConstantMatrixType(), clang::CIRGen::CIRGenTypeCache::SInt32Ty, clang::ast_matchers::type, typeCache, clang::TargetInfo::useFP16ConversionIntrinsics(), and clang::CIRGen::CIRGenTypeCache::VoidTy.
Referenced by convertType(), and clang::CIRGen::CIRGenModule::emitGlobalVarDefinition().
mlir::MLIRContext & CIRGenTypes::getMLIRContext | ( | ) | const |
Definition at line 20 of file CIRGenTypes.cpp.
Referenced by convertType().
bool CIRGenTypes::isFuncParamTypeConvertible | ( | clang::QualType | type | ) |
Return true if the specified type in a function parameter or result position can be converted to a CIR type at this point.
This boils down to being whether it is complete, as well as whether we've temporarily deferred expanding the type because we're in a recursive context.
Definition at line 28 of file CIRGenTypes.cpp.
References clang::ast_matchers::tagType, and clang::ast_matchers::type.
Referenced by isFuncTypeConvertible().
bool CIRGenTypes::isFuncTypeConvertible | ( | const clang::FunctionType * | ft | ) |
Utility to check whether a function type can be converted to a CIR type (i.e.
Code to verify a given function type is complete, i.e.
doesn't depend on an incomplete tag type).
the return type and all of the parameter types are complete. Also check to see if we are in a RS_StructPointer context, and if so whether any struct types have been pended. If so, we don't want to ask the ABI lowering code to handle a type that cannot be converted to a CIR type.
Definition at line 47 of file CIRGenTypes.cpp.
References clang::FunctionType::getReturnType(), and isFuncParamTypeConvertible().
TypeCacheTy clang::CIRGen::CIRGenTypes::typeCache |
Definition at line 58 of file CIRGenTypes.h.
Referenced by convertType().