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

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 02:26:30 PDT 2024


Author: Orlando Cazalet-Hyams
Date: 2024-03-25T09:26:27Z
New Revision: e550022b68fc75d32e44faa59ed8f02036cd8f26

URL: https://github.com/llvm/llvm-project/commit/e550022b68fc75d32e44faa59ed8f02036cd8f26
DIFF: https://github.com/llvm/llvm-project/commit/e550022b68fc75d32e44faa59ed8f02036cd8f26.diff

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

Directly load all bitcode into the new debug info format in llvm-dis.
This means that new-mode bitcode no longer round-trips back to old-mode
after parsing, and that old-mode bitcode gets auto-upgraded to new-mode
debug info (which is the current in-memory default in LLVM).

Added: 
    

Modified: 
    llvm/tools/llvm-dis/llvm-dis.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-dis/llvm-dis.cpp b/llvm/tools/llvm-dis/llvm-dis.cpp
index 8e443318dd7d2c..49154dc46c57e8 100644
--- a/llvm/tools/llvm-dis/llvm-dis.cpp
+++ b/llvm/tools/llvm-dis/llvm-dis.cpp
@@ -82,6 +82,8 @@ static cl::opt<bool> PrintThinLTOIndexOnly(
 
 extern cl::opt<bool> WriteNewDbgInfoFormat;
 
+extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat;
+
 namespace {
 
 static void printDebugLoc(const DebugLoc &DL, formatted_raw_ostream &OS) {
@@ -169,6 +171,10 @@ 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(
       std::make_unique<LLVMDisDiagnosticHandler>(argv[0]));


        


More information about the llvm-commits mailing list