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 c,cpp,h -- 
clang/test/CodeGen/sanitizer-instrumentation-builtins.c 
clang/test/CodeGen/sanitizer-instrumentation-regions-diagnostics.c 
clang/test/CodeGen/sanitizer-instrumentation-regions-pipeline.c 
llvm/unittests/Transforms/Utils/SanitizerRegionsTest.cpp 
clang/include/clang/CodeGenUtils/BackendDiagnosticHandler.h 
clang/lib/CodeGen/CGBuiltin.cpp 
clang/lib/CodeGenUtils/BackendDiagnosticHandler.cpp 
llvm/include/llvm/IR/DiagnosticInfo.h 
llvm/include/llvm/Transforms/Utils/Instrumentation.h 
llvm/lib/CodeGen/GlobalISel/IRTranslator.cpp 
llvm/lib/CodeGen/SelectionDAG/FastISel.cpp 
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp 
llvm/lib/IR/DiagnosticInfo.cpp 
llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp 
llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp 
llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp 
llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp 
llvm/lib/Transforms/Utils/Instrumentation.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/CodeGenUtils/BackendDiagnosticHandler.cpp 
b/clang/lib/CodeGenUtils/BackendDiagnosticHandler.cpp
index 9c60746d6..57bdb06bd 100644
--- a/clang/lib/CodeGenUtils/BackendDiagnosticHandler.cpp
+++ b/clang/lib/CodeGenUtils/BackendDiagnosticHandler.cpp
@@ -563,10 +563,9 @@ void 
BackendDiagnosticConsumer::SanitizerInstrumentationRegionDiagHandler(
       getBestLocationFromDebugLoc(D, BadDebugInfo, Filename, Line, Column);
 
   // The %select in the diagnostic enumerates the issues in enum order.
-  static_assert(
-      static_cast<unsigned>(
-          llvm::SanitizerInstrumentationRegionIssue::NumIssues) == 4,
-      "update warn_fe_backend_sanitizer_instrumentation_region");
+  static_assert(static_cast<unsigned>(
+                    llvm::SanitizerInstrumentationRegionIssue::NumIssues) == 4,
+                "update warn_fe_backend_sanitizer_instrumentation_region");
   Diags.Report(Loc, diag::warn_fe_backend_sanitizer_instrumentation_region)
       << static_cast<unsigned>(D.getIssue())
       << llvm::demangle(D.getFunction().getName());
diff --git a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp 
b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
index 94f5dfce9..2c6d8efa6 100644
--- a/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
+++ b/llvm/lib/Transforms/Instrumentation/MemorySanitizer.cpp
@@ -1152,16 +1152,15 @@ struct MemorySanitizerVisitor : public 
InstVisitor<MemorySanitizerVisitor> {
                          const TargetLibraryInfo &TLI)
       : Opts(MS.Opts), F(F), MS(MS), VAHelper(CreateVarArgHelper(F, MS, 
*this)),
         TLI(&TLI) {
-    RegionOnly =
-        MS.CompileKernel &&
-        F.hasFnAttribute(Attribute::DisableSanitizerInstrumentation);
+    RegionOnly = MS.CompileKernel &&
+                 F.hasFnAttribute(Attribute::DisableSanitizerInstrumentation);
 
     // Instructions outside the regions of a region-instrumented function are
     // never visited (see visit()), so the function is handled as if it had
     // sanitize_memory.
-    bool SanitizeFunction = (F.hasFnAttribute(Attribute::SanitizeMemory) ||
-                             RegionOnly) &&
-                            !Opts.msan_disable_checks;
+    bool SanitizeFunction =
+        (F.hasFnAttribute(Attribute::SanitizeMemory) || RegionOnly) &&
+        !Opts.msan_disable_checks;
     InsertChecks = SanitizeFunction;
     PropagateShadow = SanitizeFunction;
     PoisonStack = SanitizeFunction && Opts.msan_poison_stack;
@@ -1566,7 +1565,8 @@ struct MemorySanitizerVisitor : public 
InstVisitor<MemorySanitizerVisitor> {
   /// function.
   void fetchKmsanContextState(IRBuilderBase &IRB) {
     CallInst *Ctx = IRB.CreateCall(MS.MsanGetContextStateFn, {});
-    ContextStateFetches.emplace_back(Ctx, IRB.CreateStore(Ctx, 
ContextStateAlloca));
+    ContextStateFetches.emplace_back(Ctx,
+                                     IRB.CreateStore(Ctx, ContextStateAlloca));
   }
 
   /// Drop the __msan_get_context_state() calls if nothing in the regions ended
@@ -1575,9 +1575,8 @@ struct MemorySanitizerVisitor : public 
InstVisitor<MemorySanitizerVisitor> {
   /// the optimizer knows, so it would not be removed otherwise.
   void removeUnusedKmsanContextState() {
     auto *Alloca = cast_or_null<AllocaInst>(ContextStateAlloca);
-    if (!Alloca || any_of(Alloca->users(), [](const User *U) {
-          return !isa<StoreInst>(U);
-        }))
+    if (!Alloca || any_of(Alloca->users(),
+                          [](const User *U) { return !isa<StoreInst>(U); }))
       return;
     for (auto [Ctx, Store] : ContextStateFetches) {
       Store->eraseFromParent();

``````````

</details>


https://github.com/llvm/llvm-project/pull/231374
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to