Skip to content

Commit f07552d

Browse files
committed
Revert "[clang][CIR] Move CIRGen types into clang::CIRGen (llvm#115385)"
This reverts commit 40e5450.
1 parent 474b412 commit f07552d

File tree

5 files changed

+12
-15
lines changed

5 files changed

+12
-15
lines changed

clang/include/clang/CIR/CIRGenerator.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,14 @@
2525
namespace clang {
2626
class DeclGroupRef;
2727
class DiagnosticsEngine;
28-
namespace CIRGen {
29-
class CIRGenModule;
30-
} // namespace CIRGen
3128
} // namespace clang
3229

3330
namespace mlir {
3431
class MLIRContext;
3532
} // namespace mlir
3633
namespace cir {
34+
class CIRGenModule;
35+
3736
class CIRGenerator : public clang::ASTConsumer {
3837
virtual void anchor();
3938
clang::DiagnosticsEngine &diags;
@@ -45,7 +44,7 @@ class CIRGenerator : public clang::ASTConsumer {
4544

4645
protected:
4746
std::unique_ptr<mlir::MLIRContext> mlirCtx;
48-
std::unique_ptr<clang::CIRGen::CIRGenModule> cgm;
47+
std::unique_ptr<CIRGenModule> cgm;
4948

5049
public:
5150
CIRGenerator(clang::DiagnosticsEngine &diags,

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@
2222
#include "mlir/IR/Location.h"
2323
#include "mlir/IR/MLIRContext.h"
2424

25-
using namespace clang;
26-
using namespace clang::CIRGen;
27-
25+
using namespace cir;
2826
CIRGenModule::CIRGenModule(mlir::MLIRContext &context,
2927
clang::ASTContext &astctx,
3028
const clang::CodeGenOptions &cgo,

clang/lib/CIR/CodeGen/CIRGenModule.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ class LangOptions;
3131
class SourceLocation;
3232
class SourceRange;
3333
class TargetInfo;
34+
} // namespace clang
3435

35-
namespace CIRGen {
36+
using namespace clang;
37+
namespace cir {
3638

3739
/// This class organizes the cross-function state that is used while generating
3840
/// CIR code.
@@ -89,8 +91,6 @@ class CIRGenModule : public CIRGenTypeCache {
8991
DiagnosticBuilder errorNYI(SourceRange, llvm::StringRef);
9092
DiagnosticBuilder errorNYI(SourceRange, llvm::StringRef, llvm::StringRef);
9193
};
92-
} // namespace CIRGen
93-
94-
} // namespace clang
94+
} // namespace cir
9595

9696
#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENMODULE_H

clang/lib/CIR/CodeGen/CIRGenTypeCache.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
1414
#define LLVM_CLANG_LIB_CIR_CIRGENTYPECACHE_H
1515

16-
namespace clang::CIRGen {
16+
namespace cir {
1717

1818
/// This structure provides a set of types that are commonly used
1919
/// during IR emission. It's initialized once in CodeGenModule's
@@ -22,6 +22,6 @@ struct CIRGenTypeCache {
2222
CIRGenTypeCache() = default;
2323
};
2424

25-
} // namespace clang::CIRGen
25+
} // namespace cir
2626

2727
#endif // LLVM_CLANG_LIB_CIR_CODEGEN_CIRGENTYPECACHE_H

clang/lib/CIR/CodeGen/CIRGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ void CIRGenerator::Initialize(ASTContext &astCtx) {
3636

3737
mlirCtx = std::make_unique<mlir::MLIRContext>();
3838
mlirCtx->loadDialect<mlir::cir::CIRDialect>();
39-
cgm = std::make_unique<clang::CIRGen::CIRGenModule>(*mlirCtx.get(), astCtx,
40-
codeGenOpts, diags);
39+
cgm = std::make_unique<CIRGenModule>(*mlirCtx.get(), astCtx, codeGenOpts,
40+
diags);
4141
}
4242

4343
mlir::ModuleOp CIRGenerator::getModule() const { return cgm->getModule(); }

0 commit comments

Comments
 (0)