[compiler-rt] [llvm] [LowerTypeTests] Add debug info to jump table entries (PR #194493)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 27 16:46:33 PDT 2026


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 -- compiler-rt/lib/ubsan/ubsan_diag.h compiler-rt/lib/ubsan/ubsan_handlers.cpp compiler-rt/test/cfi/cross-dso/icall/icall.cpp llvm/lib/Transforms/IPO/LowerTypeTests.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/compiler-rt/lib/ubsan/ubsan_diag.h b/compiler-rt/lib/ubsan/ubsan_diag.h
index cfe0c0688..725331691 100644
--- a/compiler-rt/lib/ubsan/ubsan_diag.h
+++ b/compiler-rt/lib/ubsan/ubsan_diag.h
@@ -52,8 +52,8 @@ public:
   // SymbolizedStackHolder must outlive Location object.
   Location(const SymbolizedStackHolder &Stack) :
     Kind(LK_Symbolized), SymbolizedLoc(Stack.get()) {}
-  Location(const SymbolizedStack *Loc) :
-    Kind(Loc ? LK_Symbolized : LK_Null), SymbolizedLoc(Loc) {}
+  Location(const SymbolizedStack *Loc)
+      : Kind(Loc ? LK_Symbolized : LK_Null), SymbolizedLoc(Loc) {}
 
   LocationKind getKind() const { return Kind; }
 
diff --git a/compiler-rt/lib/ubsan/ubsan_handlers.cpp b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
index f90258d58..231324d70 100644
--- a/compiler-rt/lib/ubsan/ubsan_handlers.cpp
+++ b/compiler-rt/lib/ubsan/ubsan_handlers.cpp
@@ -879,15 +879,16 @@ static void handleCFIBadIcall(CFICheckFailData *Data, ValueHandle Function,
   {
     const SymbolizedStack *FS = FLoc.get();
     while (FS) {
-      Printf("func: %s File: %s\n\n", FS->info.function ? FS->info.function : "???", FS->info.file ? FS->info.file : "???"
-      );
+      Printf("func: %s File: %s\n\n",
+             FS->info.function ? FS->info.function : "???",
+             FS->info.file ? FS->info.file : "???");
       FS = FS->next;
     }
   }
   Printf("\n");
   const SymbolizedStack *FS = FLoc.get();
   // while (FS && FS->info.function &&
-  //        (!internal_strcmp(FS->info.function, "__ubsan_check_cfi_icall_jt") 
+  //        (!internal_strcmp(FS->info.function, "__ubsan_check_cfi_icall_jt")
   //        //||          internal_strstr(FS->info.function, ".cfi_jt"
   //         ))
   //   FS = FS->next;
diff --git a/compiler-rt/test/cfi/cross-dso/icall/icall.cpp b/compiler-rt/test/cfi/cross-dso/icall/icall.cpp
index 9e7ec0c9d..d0a8d6a76 100644
--- a/compiler-rt/test/cfi/cross-dso/icall/icall.cpp
+++ b/compiler-rt/test/cfi/cross-dso/icall/icall.cpp
@@ -10,8 +10,7 @@
 #ifdef SHARED_LIB
 void f() {
 }
-void g() {
-}
+void g() {}
 #else
 void f();
 void g();
@@ -27,7 +26,7 @@ int main(int argc, char **argv) {
   // CFI-DIAG-NEXT: note: f() defined here
   auto t = ((void (*)(int))f);
   if (argc > 1)
-   t = ((void (*)(int))g);
+    t = ((void (*)(int))g);
   t(42); // UB here
   // CHECK-DIAG: =3=
   // CHECK-NOT: =3=

``````````

</details>


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


More information about the llvm-commits mailing list