1010//
1111// ===----------------------------------------------------------------------===//
1212
13- #ifndef LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENFUNCTION_H
14- #define LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENFUNCTION_H
13+ #ifndef CLANG_LIB_CIR_CODEGEN_CIRGENFUNCTION_H
14+ #define CLANG_LIB_CIR_CODEGEN_CIRGENFUNCTION_H
1515
1616#include " CIRGenBuilder.h"
1717#include " CIRGenModule.h"
2525
2626#include " llvm/ADT/ScopedHashTable.h"
2727
28+ namespace {
29+ class ScalarExprEmitter ;
30+ } // namespace
31+
2832namespace clang ::CIRGen {
2933
3034class CIRGenFunction : public CIRGenTypeCache {
3135public:
3236 CIRGenModule &cgm;
3337
3438private:
39+ friend class ::ScalarExprEmitter;
3540 // / The builder is a helper class to create IR inside a function. The
3641 // / builder is stateful, in particular it keeps an "insertion point": this
3742 // / is where the next operations will be introduced.
@@ -58,11 +63,11 @@ class CIRGenFunction : public CIRGenTypeCache {
5863 return convertType (getContext ().getTypeDeclType (T));
5964 }
6065
61- // / Return the cir::TypeEvaluationKind of QualType \c T .
62- static cir::TypeEvaluationKind getEvaluationKind (clang::QualType T );
66+ // / Return the cir::TypeEvaluationKind of QualType \c type .
67+ static cir::TypeEvaluationKind getEvaluationKind (clang::QualType type );
6368
64- static bool hasScalarEvaluationKind (clang::QualType T ) {
65- return getEvaluationKind (T ) == cir::TEK_Scalar;
69+ static bool hasScalarEvaluationKind (clang::QualType type ) {
70+ return getEvaluationKind (type ) == cir::TEK_Scalar;
6671 }
6772
6873 CIRGenFunction (CIRGenModule &cgm, CIRGenBuilderTy &builder,
@@ -94,12 +99,14 @@ class CIRGenFunction : public CIRGenTypeCache {
9499 };
95100
96101 // / Helpers to convert Clang's SourceLocation to a MLIR Location.
97- mlir::Location getLoc (clang::SourceLocation SLoc );
98- mlir::Location getLoc (clang::SourceRange SLoc );
102+ mlir::Location getLoc (clang::SourceLocation srcLoc );
103+ mlir::Location getLoc (clang::SourceRange srcLoc );
99104 mlir::Location getLoc (mlir::Location lhs, mlir::Location rhs);
100105
101- void finishFunction (SourceLocation EndLoc);
102- mlir::LogicalResult emitFunctionBody (const clang::Stmt *Body);
106+ const clang::LangOptions &getLangOpts () const { return cgm.getLangOpts (); }
107+
108+ void finishFunction (SourceLocation endLoc);
109+ mlir::LogicalResult emitFunctionBody (const clang::Stmt *body);
103110
104111 // Build CIR for a statement. useCurrentScope should be true if no
105112 // new scopes need be created when finding a compound statement.
@@ -122,8 +129,8 @@ class CIRGenFunction : public CIRGenTypeCache {
122129 cir::FuncType funcType);
123130
124131 // / Emit code for the start of a function.
125- // / \param Loc The location to be associated with the function.
126- // / \param StartLoc The location of the function body.
132+ // / \param loc The location to be associated with the function.
133+ // / \param startLoc The location of the function body.
127134 void startFunction (clang::GlobalDecl gd, clang::QualType retTy,
128135 cir::FuncOp fn, cir::FuncType funcType,
129136 clang::SourceLocation loc, clang::SourceLocation startLoc);
0 commit comments