[llvm] [RemoveDIs] Load into new debug info format by default in llvm-dis (PR #86276)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 22 08:51:35 PDT 2024


https://github.com/OCHyams updated https://github.com/llvm/llvm-project/pull/86276

>From 3c9579cd873f8230f48c86d5005cee4248dff1aa Mon Sep 17 00:00:00 2001
From: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: Fri, 22 Mar 2024 11:55:30 +0000
Subject: [PATCH 1/2] llvm-dis

---
 llvm/tools/llvm-dis/llvm-dis.cpp | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index 8e443318dd7d2c..29d4fc92d8cd77 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/tools/llvm-dis/llvm-dis.cpp
@@ -82,6 +82,9 @@ static cl::opt<bool> PrintThinLTOIndexOnly(
 
 extern cl::opt<bool> WriteNewDbgInfoFormat;
 
+extern cl::opt<bool> WriteNewDbgInfoFormat;
+extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat;
+
 namespace {
 
 static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) {
@@ -168,6 +171,9 @@ int main(int argc, char **argv) {
 
   cl::HideUnrelatedOptions({&DisCategory, &getColorCategory()});
   cl::ParseCommandLineOptions(argc, argv, "llvm .bc -> .ll disassembler\n");
+  // Load bitcode into the new debug info format by default.
+  if (LoadBitcodeIntoNewDbgInfoFormat == cl::boolOrDefault::BOU_UNSET)
+    LoadBitcodeIntoNewDbgInfoFormat = cl::boolOrDefault::BOU_TRUE;
 
   LLVMContext Context;
   Context.setDiagnosticHandler(

>From d9e2ac132698a9d564e5c3845762d579b1e7d8f4 Mon Sep 17 00:00:00 2001
From: Orlando Cazalet-Hyams <orlando.hyams at sony.com>
Date: Fri, 22 Mar 2024 15:51:21 +0000
Subject: [PATCH 2/2] remove accidental duplication

---
 llvm/tools/llvm-dis/llvm-dis.cpp | 2 --
 1 file changed, 2 deletions(-)

diff --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index 29d4fc92d8cd77..f63ce54e7a345d 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/tools/llvm-dis/llvm-dis.cpp
@@ -80,8 +80,6 @@ static cl::opt<bool> PrintThinLTOIndexOnly(
     cl::desc("Only read thinlto index and print the index as LLVM assembly."),
     cl::init(false), cl::Hidden, cl::cat(DisCategory));
 
-extern cl::opt<bool> WriteNewDbgInfoFormat;
-
 extern cl::opt<bool> WriteNewDbgInfoFormat;
 extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat;
 



More information about the llvm-commits mailing list