Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][CodeGen][NFC] Add documentation regarding memory emission deferral #1279

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions clang/lib/CIR/CodeGen/CIRGenFunction.h
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,10 @@ class CIRGenFunction : public CIRGenTypeCache {
/// addressed later.
RValue GetUndefRValue(clang::QualType Ty);

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

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

/// Given a value and its clang type, returns the value casted to its memory
/// representation.
/// Note: CIR defers most of the special casting to the final lowering passes
/// to conserve the high level information.
mlir::Value emitToMemory(mlir::Value Value, clang::QualType Ty);

void emitDeclRefExprDbgValue(const DeclRefExpr *E, const APValue &Init);

/// Store the specified rvalue into the specified
Expand Down
3 changes: 2 additions & 1 deletion clang/lib/CIR/CodeGen/CIRGenTypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,8 @@ class CIRGenTypes {
/// convertType in that it is used to convert to the memory representation
/// for a type. For example, the scalar representation for _Bool is i1, but
/// the memory representation is usually i8 or i32, depending on the target.
// TODO: convert this comment to account for MLIR's equivalence
/// Note: CIR defers most of the special conversions to the final lowering
/// passes to conserve the high level information.
mlir::Type convertTypeForMem(clang::QualType, bool forBitField = false);

/// Get the CIR function type for \arg Info.
Expand Down
Loading