github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code.
:warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp,h --
clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.cpp
clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.h
clang/unittests/CIR/CIRDiagnosticHandlerTest.cpp
clang/lib/CIR/CodeGen/CIRGenerator.cpp
clang/lib/CIR/FrontendAction/CIRGenAction.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.cpp
b/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.cpp
index 7c42f6966..5f0045a7c 100644
--- a/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.cpp
+++ b/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.cpp
@@ -21,16 +21,16 @@
namespace cir {
-CIRDiagnosticHandler::CIRDiagnosticHandler(
- mlir::MLIRContext *ctx, clang::DiagnosticsEngine &diags,
- clang::SourceManager &srcMgr, clang::FileManager &fileMgr)
+CIRDiagnosticHandler::CIRDiagnosticHandler(mlir::MLIRContext *ctx,
+ clang::DiagnosticsEngine &diags,
+ clang::SourceManager &srcMgr,
+ clang::FileManager &fileMgr)
: mlir::ScopedDiagnosticHandler(ctx), Diags(diags), SrcMgr(srcMgr),
FileMgr(fileMgr) {
setHandler([this](mlir::Diagnostic &D) { return handle(D); });
}
-clang::SourceLocation
-CIRDiagnosticHandler::translateLoc(mlir::Location loc) {
+clang::SourceLocation CIRDiagnosticHandler::translateLoc(mlir::Location loc) {
// Walk common location wrappers to reach a usable file/line/column triple.
// Anything we can't translate becomes an invalid SourceLocation, which the
// diagnostics engine renders without a source line.
@@ -42,8 +42,8 @@ CIRDiagnosticHandler::translateLoc(mlir::Location loc) {
auto fileRef = FileMgr.getOptionalFileRef(file.getFilename().getValue());
if (!fileRef)
return clang::SourceLocation();
- return SrcMgr.translateFileLineCol(&fileRef->getFileEntry(),
- file.getLine(), file.getColumn());
+ return SrcMgr.translateFileLineCol(&fileRef->getFileEntry(),
file.getLine(),
+ file.getColumn());
}
if (auto fused = mlir::dyn_cast<mlir::FusedLoc>(loc)) {
for (mlir::Location child : fused.getLocations()) {
diff --git a/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.h
b/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.h
index 6a2e99125..a5610aaff 100644
--- a/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.h
+++ b/clang/lib/CIR/FrontendAction/CIRDiagnosticHandler.h
@@ -34,8 +34,7 @@ namespace cir {
/// fall back to an invalid clang::SourceLocation.
class CIRDiagnosticHandler : public mlir::ScopedDiagnosticHandler {
public:
- CIRDiagnosticHandler(mlir::MLIRContext *ctx,
- clang::DiagnosticsEngine &diags,
+ CIRDiagnosticHandler(mlir::MLIRContext *ctx, clang::DiagnosticsEngine &diags,
clang::SourceManager &srcMgr,
clang::FileManager &fileMgr);
diff --git a/clang/unittests/CIR/CIRDiagnosticHandlerTest.cpp
b/clang/unittests/CIR/CIRDiagnosticHandlerTest.cpp
index d5917bc1c..a3e26da6d 100644
--- a/clang/unittests/CIR/CIRDiagnosticHandlerTest.cpp
+++ b/clang/unittests/CIR/CIRDiagnosticHandlerTest.cpp
@@ -76,8 +76,7 @@ public:
class CIRDiagnosticHandlerTest : public ::testing::Test {
protected:
CIRDiagnosticHandlerTest()
- : Consumer(new CapturingConsumer),
- FileMgr(FileMgrOpts),
+ : Consumer(new CapturingConsumer), FileMgr(FileMgrOpts),
Diags(clang::DiagnosticIDs::create(), DiagOpts, Consumer.get(),
/*ShouldOwnClient=*/false),
SrcMgr(Diags, FileMgr) {
@@ -116,8 +115,7 @@ TEST_F(CIRDiagnosticHandlerTest,
ErrorRoutedWithSeverityAndLocation) {
ASSERT_EQ(Consumer->Diags.size(), 1u);
const CapturedDiag &D = Consumer->Diags.front();
EXPECT_EQ(D.Level, clang::DiagnosticsEngine::Error);
- EXPECT_EQ(D.ID,
- static_cast<unsigned>(clang::diag::err_cir_mlir_diagnostic));
+ EXPECT_EQ(D.ID, static_cast<unsigned>(clang::diag::err_cir_mlir_diagnostic));
EXPECT_EQ(D.Message, "boom");
EXPECT_TRUE(D.HasLoc);
EXPECT_EQ(D.Line, 2u);
@@ -136,9 +134,9 @@ TEST_F(CIRDiagnosticHandlerTest, WarningRoutesToWarningId) {
TEST_F(CIRDiagnosticHandlerTest, RemarkRoutesToRemarkId) {
// Remarks are off by default. Promote -Rclangir so the consumer sees them.
- bool unknownGroup = Diags.setSeverityForGroup(
- clang::diag::Flavor::Remark, "remark-clangir",
- clang::diag::Severity::Remark);
+ bool unknownGroup =
+ Diags.setSeverityForGroup(clang::diag::Flavor::Remark, "remark-clangir",
+ clang::diag::Severity::Remark);
ASSERT_FALSE(unknownGroup) << "remark-clangir group not registered";
cir::CIRDiagnosticHandler Handler(&MLIRCtx, Diags, SrcMgr, FileMgr);
mlir::emitRemark(fileLoc(1, 1)) << "fyi";
``````````
</details>
https://github.com/llvm/llvm-project/pull/199297
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits