clang 24.0.0git
cir::RecordRewritingTypeConverter Class Reference

A type converter that converts the types nested in pointers, arrays, functions and records. More...

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/Dialect/Transforms/RecordTypeConverter.h"

Inheritance diagram for cir::RecordRewritingTypeConverter:
[legend]

Public Member Functions

 RecordRewritingTypeConverter (mlir::MLIRContext &context)
virtual ~RecordRewritingTypeConverter ()=default
void restoreRecordTypeNames ()
 Remove the temporary name of every record rebuilt by this converter.

Protected Member Functions

virtual bool typeMayChange (mlir::Type type) const
 Whether type itself, ignoring nested types, may change.

Detailed Description

A type converter that converts the types nested in pointers, arrays, functions and records.

Identified records can't be modified in place, so each one is rebuilt under a temporary name (see RecordType::getABIConvertedName). The conversion keeps a stack of the records being converted, which resolves recursive records. Once the conversion is done, restoreRecordTypeNames() gives the rebuilt records their original names back.

Subclasses add conversions for the types they rewrite. The type converter tries the most recently added conversion first, so a subclass can also replace one of the conversions registered here.

Every record is rebuilt unless typeMayChange() is overridden.

Definition at line 42 of file RecordTypeConverter.h.

Constructor & Destructor Documentation

◆ RecordRewritingTypeConverter()

RecordRewritingTypeConverter::RecordRewritingTypeConverter ( mlir::MLIRContext & context)
explicit

Definition at line 20 of file RecordTypeConverter.cpp.

◆ ~RecordRewritingTypeConverter()

virtual cir::RecordRewritingTypeConverter::~RecordRewritingTypeConverter ( )
virtualdefault

Member Function Documentation

◆ restoreRecordTypeNames()

void RecordRewritingTypeConverter::restoreRecordTypeNames ( )

Remove the temporary name of every record rebuilt by this converter.

Definition at line 62 of file RecordTypeConverter.cpp.

◆ typeMayChange()

virtual bool cir::RecordRewritingTypeConverter::typeMayChange ( mlir::Type type) const
inlineprotectedvirtual

Whether type itself, ignoring nested types, may change.

Records are rebuilt only if some type they reach returns true.

Definition at line 53 of file RecordTypeConverter.h.


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