[llvm] 8263a88 - [RemoveDIs] Load into new debug info format by default in llvm-link (#86274)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 25 02:29:23 PDT 2024


Author: Orlando Cazalet-Hyams
Date: 2024-03-25T09:29:19Z
New Revision: 8263a883342d9925a4a1fd9752efc8deda5840fc

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

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

Directly load all bitcode into the new debug info format in llvm-link.
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-link/llvm-link.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/tools/llvm-link/llvm-link.cpp b/llvm/tools/llvm-link/llvm-link.cpp
index 9e7f2c3ebac437..9049cb5e858002 100644
--- a/llvm/tools/llvm-link/llvm-link.cpp
+++ b/llvm/tools/llvm-link/llvm-link.cpp
@@ -136,6 +136,8 @@ static cl::opt<bool> TryUseNewDbgInfoFormat(
 
 extern cl::opt<bool> UseNewDbgInfoFormat;
 
+extern cl::opt<cl::boolOrDefault> LoadBitcodeIntoNewDbgInfoFormat;
+
 static ExitOnError ExitOnErr;
 
 // Read the specified bitcode file in and return it. This routine searches the
@@ -480,6 +482,10 @@ int main(int argc, char **argv) {
   cl::HideUnrelatedOptions({&LinkCategory, &getColorCategory()});
   cl::ParseCommandLineOptions(argc, argv, "llvm linker\n");
 
+  // Load bitcode into the new debug info format by default.
+  if (LoadBitcodeIntoNewDbgInfoFormat == cl::boolOrDefault::BOU_UNSET)
+    LoadBitcodeIntoNewDbgInfoFormat = cl::boolOrDefault::BOU_TRUE;
+
   // RemoveDIs debug-info transition: tests may request that we /try/ to use the
   // new debug-info format.
   if (TryUseNewDbgInfoFormat) {


        


More information about the llvm-commits mailing list