[llvm] Change type of DiagnosticHandlerTy (PR #86504)

Abhin P Jose via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 06:43:52 PDT 2024


https://github.com/Abhinkop updated https://github.com/llvm/llvm-project/pull/86504

>From 661018b599d0e34eae3d968593fa92154e1466d0 Mon Sep 17 00:00:00 2001
From: Abhin P Jose <abhinjose at live.com>
Date: Mon, 25 Mar 2024 13:00:05 +0000
Subject: [PATCH 1/2] Change type of DiagnosticHandlerTy

---
 llvm/include/llvm/IR/DiagnosticHandler.h  | 4 ++--
 llvm/unittests/Linker/LinkModulesTest.cpp | 2 +-
 llvm/unittests/Support/ThreadPool.cpp     | 2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/include/llvm/IR/DiagnosticHandler.h b/llvm/include/llvm/IR/DiagnosticHandler.h
index db7d7444f75f05..aa1e4d14e82b61 100644
--- a/llvm/include/llvm/IR/DiagnosticHandler.h
+++ b/llvm/include/llvm/IR/DiagnosticHandler.h
@@ -28,7 +28,7 @@ struct DiagnosticHandler {
       : DiagnosticContext(DiagContext) {}
   virtual ~DiagnosticHandler() = default;
 
-  using DiagnosticHandlerTy = void (*)(const DiagnosticInfo &DI, void *Context);
+  using DiagnosticHandlerTy = void (*)(const DiagnosticInfo* DI, void *Context);
 
   /// DiagHandlerCallback is settable from the C API and base implementation
   /// of DiagnosticHandler will call it from handleDiagnostics(). Any derived
@@ -42,7 +42,7 @@ struct DiagnosticHandler {
   /// with a prefix based on the severity.
   virtual bool handleDiagnostics(const DiagnosticInfo &DI) {
     if (DiagHandlerCallback) {
-      DiagHandlerCallback(DI, DiagnosticContext);
+      DiagHandlerCallback(&DI, DiagnosticContext);
       return true;
     }
     return false;
diff --git a/llvm/unittests/Linker/LinkModulesTest.cpp b/llvm/unittests/Linker/LinkModulesTest.cpp
index 182ce73178c1d4..884e20e89c5c2f 100644
--- a/llvm/unittests/Linker/LinkModulesTest.cpp
+++ b/llvm/unittests/Linker/LinkModulesTest.cpp
@@ -72,7 +72,7 @@ class LinkModuleTest : public testing::Test {
   BasicBlock *ExitBB;
 };
 
-static void expectNoDiags(const DiagnosticInfo &DI, void *C) {
+static void expectNoDiags(const DiagnosticInfo *DI, void *C) {
   llvm_unreachable("expectNoDiags called!");
 }
 
diff --git a/llvm/unittests/Support/ThreadPool.cpp b/llvm/unittests/Support/ThreadPool.cpp
index d74c625d122950..381b4fc2a26b8e 100644
--- a/llvm/unittests/Support/ThreadPool.cpp
+++ b/llvm/unittests/Support/ThreadPool.cpp
@@ -126,7 +126,7 @@ using ThreadPoolImpls = ::testing::Types<
 #endif
     SingleThreadExecutor>;
 
-TYPED_TEST_SUITE(ThreadPoolTest, ThreadPoolImpls);
+TYPED_TEST_SUITE(ThreadPoolTest, ThreadPoolImpls, );
 
 #define CHECK_UNSUPPORTED()                                                    \
   do {                                                                         \

>From fa558b558455eff0d40dc29ce0802af8860e64aa Mon Sep 17 00:00:00 2001
From: Abhin P Jose <abhinjose at live.com>
Date: Mon, 25 Mar 2024 13:43:18 +0000
Subject: [PATCH 2/2] Formating

---
 llvm/include/llvm/IR/DiagnosticHandler.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/include/llvm/IR/DiagnosticHandler.h b/llvm/include/llvm/IR/DiagnosticHandler.h
index aa1e4d14e82b61..1f0544b9fa9f8f 100644
--- a/llvm/include/llvm/IR/DiagnosticHandler.h
+++ b/llvm/include/llvm/IR/DiagnosticHandler.h
@@ -28,7 +28,7 @@ struct DiagnosticHandler {
       : DiagnosticContext(DiagContext) {}
   virtual ~DiagnosticHandler() = default;
 
-  using DiagnosticHandlerTy = void (*)(const DiagnosticInfo* DI, void *Context);
+  using DiagnosticHandlerTy = void (*)(const DiagnosticInfo *DI, void *Context);
 
   /// DiagHandlerCallback is settable from the C API and base implementation
   /// of DiagnosticHandler will call it from handleDiagnostics(). Any derived



More information about the llvm-commits mailing list