[llvm] Give a warning when no dwo files are found (PR #94336)

Jinjie Huang via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 4 04:05:39 PDT 2024


https://github.com/Labman-001 updated https://github.com/llvm/llvm-project/pull/94336

>From 673778784c089d0146b293bd5c6c7331d736fb25 Mon Sep 17 00:00:00 2001
From: huangjinjie <huangjinjie at bytedance.com>
Date: Tue, 4 Jun 2024 18:31:03 +0800
Subject: [PATCH 1/3] Give a warning when now dwo found

---
 llvm/tools/llvm-dwp/llvm-dwp.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index 81556b3ad4bcb..f0edaeb07f0ba 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -188,8 +188,10 @@ int llvm_dwp_main(int argc, char **argv, const llvm::ToolContext &) {
                         std::make_move_iterator(DWOs->end()));
   }
 
-  if (DWOFilenames.empty())
+  if (DWOFilenames.empty()) {
+    WithColor::defaultWarningHandler(make_error<DWPError>("No dwo files found!\n"));
     return 0;
+  }
 
   std::string ErrorStr;
   StringRef Context = "dwarf streamer init";

>From 5899de9fb576489e9bdb30adee6a535a98942ace Mon Sep 17 00:00:00 2001
From: huangjinjie <huangjinjie at bytedance.com>
Date: Tue, 4 Jun 2024 19:00:32 +0800
Subject: [PATCH 2/3] Give a warning when no dwo found

---
 llvm/tools/llvm-dwp/llvm-dwp.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index f0edaeb07f0ba..0b3941bdc27e0 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -189,8 +189,9 @@ int llvm_dwp_main(int argc, char **argv, const llvm::ToolContext &) {
   }
 
   if (DWOFilenames.empty()) {
-    WithColor::defaultWarningHandler(make_error<DWPError>("No dwo files found!\n"));
-    return 0;
+    WithColor::defaultWarningHandler(
+        make_error<DWPError>("No dwo files found!"));
+      return 0;
   }
 
   std::string ErrorStr;

>From 2a54154e77f27ccd99978fce7b9f790702cd933b Mon Sep 17 00:00:00 2001
From: huangjinjie <huangjinjie at bytedance.com>
Date: Tue, 4 Jun 2024 19:05:25 +0800
Subject: [PATCH 3/3] Give a warning when no dwo found

---
 llvm/tools/llvm-dwp/llvm-dwp.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/llvm/tools/llvm-dwp/llvm-dwp.cpp b/llvm/tools/llvm-dwp/llvm-dwp.cpp
index 0b3941bdc27e0..3da408b7e8e8c 100644
--- a/llvm/tools/llvm-dwp/llvm-dwp.cpp
+++ b/llvm/tools/llvm-dwp/llvm-dwp.cpp
@@ -191,7 +191,7 @@ int llvm_dwp_main(int argc, char **argv, const llvm::ToolContext &) {
   if (DWOFilenames.empty()) {
     WithColor::defaultWarningHandler(
         make_error<DWPError>("No dwo files found!"));
-      return 0;
+    return 0;
   }
 
   std::string ErrorStr;



More information about the llvm-commits mailing list