clang 20.0.0git
Public Types | Public Member Functions | Public Attributes | List of all members
clang::CIRGen::CIRGenTypes Class Reference

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
 

Detailed Description

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.

Member Typedef Documentation

◆ TypeCacheTy

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.

Constructor & Destructor Documentation

◆ CIRGenTypes()

CIRGenTypes::CIRGenTypes ( CIRGenModule cgm)

Definition at line 14 of file CIRGenTypes.cpp.

◆ ~CIRGenTypes()

CIRGenTypes::~CIRGenTypes ( )

Definition at line 18 of file CIRGenTypes.cpp.

Member Function Documentation

◆ convertType()

mlir::Type CIRGenTypes::convertType ( clang::QualType  type)

◆ getMLIRContext()

mlir::MLIRContext & CIRGenTypes::getMLIRContext ( ) const

Definition at line 20 of file CIRGenTypes.cpp.

Referenced by convertType().

◆ isFuncParamTypeConvertible()

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().

◆ 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().

Member Data Documentation

◆ typeCache

TypeCacheTy clang::CIRGen::CIRGenTypes::typeCache

Definition at line 58 of file CIRGenTypes.h.

Referenced by convertType().


The documentation for this class was generated from the following files: