Skip to content

Conversation

@badumbatish
Copy link
Contributor

draft PR for avoid deletion,

@github-actions
Copy link

github-actions bot commented Nov 21, 2025

⚠️ C/C++ code formatter, clang-format found issues in your code. ⚠️

You can test this locally with the following command:
git-clang-format --diff origin/main HEAD --extensions c,cpp,h -- clang/include/clang/CIR/Analysis/CIRAnalysisKind.h clang/include/clang/CIR/Analysis/FallThroughWarning.h clang/lib/CIR/Analysis/CIRAnalysisKind.cpp clang/lib/CIR/Analysis/FallThroughWarning.cpp clang/test/CIR/Analysis/fallthrough_1.c clang/test/CIR/Analysis/fallthrough_2.c clang/include/clang/Frontend/FrontendOptions.h clang/lib/CIR/FrontendAction/CIRGenAction.cpp clang/lib/Sema/AnalysisBasedWarnings.cpp --diff_from_common_commit

⚠️
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.
⚠️

View the diff from clang-format here.
diff --git a/clang/include/clang/CIR/Analysis/CIRAnalysisKind.h b/clang/include/clang/CIR/Analysis/CIRAnalysisKind.h
index 304acfcf4..ae5cb2427 100644
--- a/clang/include/clang/CIR/Analysis/CIRAnalysisKind.h
+++ b/clang/include/clang/CIR/Analysis/CIRAnalysisKind.h
@@ -49,14 +49,10 @@ public:
   }
 
   /// Enable a specific analysis
-  void enable(CIRAnalysisKind kind) {
-    mask |= static_cast<unsigned>(kind);
-  }
+  void enable(CIRAnalysisKind kind) { mask |= static_cast<unsigned>(kind); }
 
   /// Disable a specific analysis
-  void disable(CIRAnalysisKind kind) {
-    mask &= ~static_cast<unsigned>(kind);
-  }
+  void disable(CIRAnalysisKind kind) { mask &= ~static_cast<unsigned>(kind); }
 
   /// Check if any analysis is enabled
   bool hasAny() const { return mask != 0; }
diff --git a/clang/lib/CIR/Analysis/CIRAnalysisKind.cpp b/clang/lib/CIR/Analysis/CIRAnalysisKind.cpp
index f27f8dbeb..c5d44dfc7 100644
--- a/clang/lib/CIR/Analysis/CIRAnalysisKind.cpp
+++ b/clang/lib/CIR/Analysis/CIRAnalysisKind.cpp
@@ -15,25 +15,24 @@
 namespace cir {
 
 CIRAnalysisKind parseCIRAnalysisKind(llvm::StringRef name) {
- auto parseResult =  llvm::StringSwitch<CIRAnalysisKind>(name)
-      .Case("fallthrough", CIRAnalysisKind::FallThrough)
-      .Case("fall-through", CIRAnalysisKind::FallThrough)
-      .Default(CIRAnalysisKind::Unrecognized);
+  auto parseResult = llvm::StringSwitch<CIRAnalysisKind>(name)
+                         .Case("fallthrough", CIRAnalysisKind::FallThrough)
+                         .Case("fall-through", CIRAnalysisKind::FallThrough)
+                         .Default(CIRAnalysisKind::Unrecognized);
 
- return parseResult;
+  return parseResult;
 }
 
-
-CIRAnalysisSet parseCIRAnalysisList(
-    const std::vector<std::string> &analysisList,
-    llvm::SmallVectorImpl<std::string> *invalidNames) {
+CIRAnalysisSet
+parseCIRAnalysisList(const std::vector<std::string> &analysisList,
+                     llvm::SmallVectorImpl<std::string> *invalidNames) {
   CIRAnalysisSet result;
 
   for (const std::string &item : analysisList) {
     llvm::StringRef remaining = item;
     CIRAnalysisKind parseKind = parseCIRAnalysisKind(remaining);
     if (parseKind == CIRAnalysisKind::Unrecognized) {
-      llvm::errs() << "Unrecognized CIR analysis option: "  << remaining << "\n";
+      llvm::errs() << "Unrecognized CIR analysis option: " << remaining << "\n";
       continue;
     }
     result.enable(parseKind);
diff --git a/clang/lib/CIR/FrontendAction/CIRGenAction.cpp b/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
index 627265cec..b409454aa 100644
--- a/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
+++ b/clang/lib/CIR/FrontendAction/CIRGenAction.cpp
@@ -11,12 +11,12 @@
 #include "mlir/IR/OwningOpRef.h"
 #include "clang/Basic/DiagnosticFrontend.h"
 #include "clang/Basic/DiagnosticSema.h"
+#include "clang/CIR/Analysis/CIRAnalysisKind.h"
+#include "clang/CIR/Analysis/FallThroughWarning.h"
 #include "clang/CIR/CIRGenerator.h"
 #include "clang/CIR/CIRToCIRPasses.h"
 #include "clang/CIR/Dialect/IR/CIRDialect.h"
 #include "clang/CIR/LowerToLLVM.h"
-#include "clang/CIR/Analysis/CIRAnalysisKind.h"
-#include "clang/CIR/Analysis/FallThroughWarning.h"
 #include "clang/CodeGen/BackendUtil.h"
 #include "clang/Frontend/CompilerInstance.h"
 #include "clang/Sema/AnalysisBasedWarnings.h"

@github-actions
Copy link

github-actions bot commented Nov 23, 2025

🐧 Linux x64 Test Results

  • 3053 tests passed
  • 7 tests skipped

All tests passed but another part of the build failed. Click on a failure below to see the details.

tools/clang/lib/CIR/Analysis/CMakeFiles/obj.clangCIRSema.dir/FallThroughWarning.cpp.o
FAILED: tools/clang/lib/CIR/Analysis/CMakeFiles/obj.clangCIRSema.dir/FallThroughWarning.cpp.o
sccache /opt/llvm/bin/clang++ -DCLANG_EXPORTS -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/lib/CIR/Analysis -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/Analysis -I/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/clang/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/llvm/../mlir/include -I/home/gha/actions-runner/_work/llvm-project/llvm-project/build/tools/mlir/include -gmlt -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wc++98-compat-extra-semi -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wsuggest-override -Wstring-conversion -Wno-pass-failed -Wmisleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -Wno-nested-anon-types -O3 -DNDEBUG -std=c++17  -fno-exceptions -funwind-tables -fno-rtti -UNDEBUG -MD -MT tools/clang/lib/CIR/Analysis/CMakeFiles/obj.clangCIRSema.dir/FallThroughWarning.cpp.o -MF tools/clang/lib/CIR/Analysis/CMakeFiles/obj.clangCIRSema.dir/FallThroughWarning.cpp.o.d -o tools/clang/lib/CIR/Analysis/CMakeFiles/obj.clangCIRSema.dir/FallThroughWarning.cpp.o -c /home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/Analysis/FallThroughWarning.cpp
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/Analysis/FallThroughWarning.cpp:199:18: error: unused variable 'lBrace' [-Werror,-Wunused-variable]
199 |   SourceLocation lBrace = body->getBeginLoc(), rBrace = body->getEndLoc();
|                  ^~~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/Analysis/FallThroughWarning.cpp:304:12: error: unused variable 'count' [-Werror,-Wunused-variable]
304 |   unsigned count = liveSet.size();
|            ^~~~~
/home/gha/actions-runner/_work/llvm-project/llvm-project/clang/lib/CIR/Analysis/FallThroughWarning.cpp:311:9: error: unused variable 'exitBlock' [-Werror,-Wunused-variable]
311 |   auto &exitBlock = cfg.getBody().back();
|         ^~~~~~~~~
3 errors generated.

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants