Skip to content

Commit a9ea2d8

Browse files
committed
Formatting and style changes
1 parent 41546e2 commit a9ea2d8

File tree

3 files changed

+16
-18
lines changed

3 files changed

+16
-18
lines changed

clang/include/clang/CIR/LowerToLLVM.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class ModuleOp;
2828
namespace cir {
2929

3030
namespace direct {
31-
std::unique_ptr<llvm::Module> lowerDirectlyFromCIRToLLVMIR(
32-
mlir::ModuleOp M, llvm::LLVMContext &Ctx);
31+
std::unique_ptr<llvm::Module>
32+
lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp M, llvm::LLVMContext &Ctx);
3333
} // namespace direct
3434
} // namespace cir
3535

clang/lib/CIR/FrontendAction/CIRGenAction.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
//===----------------------------------------------------------------------===//
88

99
#include "clang/CIR/FrontendAction/CIRGenAction.h"
10+
#include "mlir/IR/MLIRContext.h"
11+
#include "mlir/IR/OwningOpRef.h"
1012
#include "clang/CIR/CIRGenerator.h"
1113
#include "clang/CIR/LowerToLLVM.h"
1214
#include "clang/CodeGen/BackendUtil.h"
1315
#include "clang/Frontend/CompilerInstance.h"
1416
#include "llvm/IR/Module.h"
15-
#include "mlir/IR/MLIRContext.h"
16-
#include "mlir/IR/OwningOpRef.h"
1717

1818
using namespace cir;
1919
using namespace clang;
@@ -51,8 +51,7 @@ class CIRGenConsumer : public clang::ASTConsumer {
5151
std::unique_ptr<CIRGenerator> Gen;
5252

5353
public:
54-
CIRGenConsumer(CIRGenAction::OutputType Action,
55-
CompilerInstance &CI,
54+
CIRGenConsumer(CIRGenAction::OutputType Action, CompilerInstance &CI,
5655
std::unique_ptr<raw_pwrite_stream> OS)
5756
: Action(Action), CI(CI), OutputStream(std::move(OS)),
5857
FS(&CI.getVirtualFileSystem()),
@@ -88,10 +87,9 @@ class CIRGenConsumer : public clang::ASTConsumer {
8887
std::move(MLIRCtx), LLVMCtx);
8988

9089
BackendAction BEAction = getBackendActionFromOutputType(Action);
91-
emitBackendOutput(CI, CI.getCodeGenOpts(),
92-
C.getTargetInfo().getDataLayoutString(),
93-
LLVMModule.get(), BEAction, FS,
94-
std::move(OutputStream));
90+
emitBackendOutput(
91+
CI, CI.getCodeGenOpts(), C.getTargetInfo().getDataLayoutString(),
92+
LLVMModule.get(), BEAction, FS, std::move(OutputStream));
9593
break;
9694
}
9795
}
@@ -125,8 +123,8 @@ CIRGenAction::CreateASTConsumer(CompilerInstance &CI, StringRef InFile) {
125123
if (!Out)
126124
Out = getOutputStream(CI, InFile, Action);
127125

128-
auto Result = std::make_unique<cir::CIRGenConsumer>(
129-
Action, CI, std::move(Out));
126+
auto Result =
127+
std::make_unique<cir::CIRGenConsumer>(Action, CI, std::move(Out));
130128

131129
return Result;
132130
}

clang/lib/CIR/Lowering/DirectToLLVM/LowerToLLVM.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,24 @@
1818
#include "llvm/IR/Module.h"
1919
#include "llvm/Support/TimeProfiler.h"
2020

21-
2221
using namespace cir;
2322
using namespace llvm;
2423

2524
namespace cir {
2625
namespace direct {
2726

2827
std::unique_ptr<llvm::Module>
29-
lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp theModule, LLVMContext &llvmCtx) {
28+
lowerDirectlyFromCIRToLLVMIR(mlir::ModuleOp MOp, LLVMContext &LLVMCtx) {
3029
llvm::TimeTraceScope scope("lower from CIR to LLVM directly");
3130

32-
auto ModuleName = theModule.getName();
33-
auto llvmModule = std::make_unique<llvm::Module>(ModuleName ? *ModuleName : "CIRToLLVMModule", llvmCtx);
31+
std::optional<StringRef> ModuleName = MOp.getName();
32+
auto M = std::make_unique<llvm::Module>(
33+
ModuleName ? *ModuleName : "CIRToLLVMModule", LLVMCtx);
3434

35-
if (!llvmModule)
35+
if (!M)
3636
report_fatal_error("Lowering from LLVMIR dialect to llvm IR failed!");
3737

38-
return llvmModule;
38+
return M;
3939
}
4040
} // namespace direct
4141
} // namespace cir

0 commit comments

Comments
 (0)