[clang] [CIR] Upstream support for switch statements case kinds (PR #138003)

via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 30 10:59:48 PDT 2025


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 HEAD~1 HEAD --extensions cpp,h -- clang/include/clang/CIR/MissingFeatures.h clang/lib/CIR/CodeGen/CIRGenFunction.h clang/lib/CIR/CodeGen/CIRGenStmt.cpp clang/test/CIR/CodeGen/switch.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/clang/lib/CIR/CodeGen/CIRGenFunction.h b/clang/lib/CIR/CodeGen/CIRGenFunction.h
index fb1a7dc75..9a1abe380 100644
--- a/clang/lib/CIR/CodeGen/CIRGenFunction.h
+++ b/clang/lib/CIR/CodeGen/CIRGenFunction.h
@@ -535,7 +535,6 @@ public:
   mlir::LogicalResult emitDeclStmt(const clang::DeclStmt &s);
   LValue emitDeclRefLValue(const clang::DeclRefExpr *e);
 
-
   mlir::LogicalResult emitDefaultStmt(const clang::DefaultStmt &s,
                                       mlir::Type condType,
                                       bool buildingTopLevelCase);
diff --git a/clang/lib/CIR/CodeGen/CIRGenStmt.cpp b/clang/lib/CIR/CodeGen/CIRGenStmt.cpp
index 56e9ba04c..13b9cdf40 100644
--- a/clang/lib/CIR/CodeGen/CIRGenStmt.cpp
+++ b/clang/lib/CIR/CodeGen/CIRGenStmt.cpp
@@ -429,7 +429,6 @@ mlir::LogicalResult CIRGenFunction::emitBreakStmt(const clang::BreakStmt &s) {
   return mlir::success();
 }
 
-
 const CaseStmt *CIRGenFunction::foldCaseStmt(const clang::CaseStmt &s,
                                              mlir::Type condType,
                                              mlir::ArrayAttr &value,
@@ -570,10 +569,9 @@ mlir::LogicalResult CIRGenFunction::emitCaseStmt(const CaseStmt &s,
                                 buildingTopLevelCase);
 }
 
-
-  mlir::LogicalResult CIRGenFunction::emitDefaultStmt(const clang::DefaultStmt &s,
-                                      mlir::Type condType,
-                                      bool buildingTopLevelCase) {
+mlir::LogicalResult CIRGenFunction::emitDefaultStmt(const clang::DefaultStmt &s,
+                                                    mlir::Type condType,
+                                                    bool buildingTopLevelCase) {
   return emitCaseDefaultCascade(&s, condType, builder.getArrayAttr({}),
                                 cir::CaseOpKind::Default, buildingTopLevelCase);
 }

``````````

</details>


https://github.com/llvm/llvm-project/pull/138003


More information about the cfe-commits mailing list