Skip to content

Commit d2e8197

Browse files
orbirilanza
authored andcommitted
[CIR][CodeGen][NFC] Add documentation regarding memory emission deferral (#1279)
1 parent 489de07 commit d2e8197

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

clang/lib/CIR/CodeGen/CIRGenFunction.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1114,6 +1114,10 @@ class CIRGenFunction : public CIRGenTypeCache {
11141114
/// addressed later.
11151115
RValue GetUndefRValue(clang::QualType Ty);
11161116

1117+
/// Given a value and its clang type, returns the value casted from its memory
1118+
/// representation.
1119+
/// Note: CIR defers most of the special casting to the final lowering passes
1120+
/// to conserve the high level information.
11171121
mlir::Value emitFromMemory(mlir::Value Value, clang::QualType Ty);
11181122

11191123
mlir::LogicalResult emitAsmStmt(const clang::AsmStmt &S);
@@ -1339,7 +1343,12 @@ class CIRGenFunction : public CIRGenTypeCache {
13391343
}
13401344
void emitStoreOfScalar(mlir::Value value, LValue lvalue, bool isInit);
13411345

1346+
/// Given a value and its clang type, returns the value casted to its memory
1347+
/// representation.
1348+
/// Note: CIR defers most of the special casting to the final lowering passes
1349+
/// to conserve the high level information.
13421350
mlir::Value emitToMemory(mlir::Value Value, clang::QualType Ty);
1351+
13431352
void emitDeclRefExprDbgValue(const DeclRefExpr *E, const APValue &Init);
13441353

13451354
/// Store the specified rvalue into the specified

clang/lib/CIR/CodeGen/CIRGenTypes.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,8 @@ class CIRGenTypes {
186186
/// convertType in that it is used to convert to the memory representation
187187
/// for a type. For example, the scalar representation for _Bool is i1, but
188188
/// the memory representation is usually i8 or i32, depending on the target.
189-
// TODO: convert this comment to account for MLIR's equivalence
189+
/// Note: CIR defers most of the special conversions to the final lowering
190+
/// passes to conserve the high level information.
190191
mlir::Type convertTypeForMem(clang::QualType, bool forBitField = false);
191192

192193
/// Get the CIR function type for \arg Info.

0 commit comments

Comments
 (0)