[llvm] [RemoveDIs] Add flag to control loading into new debug mode from bitcode (PR #85649)

Carlos Alberto Enciso via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 19 02:11:31 PDT 2024


================
@@ -4276,9 +4283,11 @@ Error BitcodeReader::parseGlobalIndirectSymbolRecord(
 Error BitcodeReader::parseModule(uint64_t ResumeBit,
                                  bool ShouldLazyLoadMetadata,
                                  ParserCallbacks Callbacks) {
-  // Force the debug-info mode into the old format for now.
-  // FIXME: Remove this once all tools support RemoveDIs.
-  TheModule->IsNewDbgInfoFormat = false;
+  // Load directly into RemoveDIs format if LoadBitcodeIntoNewDbgInforFormat
+  // has been set to true (default action: load into the old debug format).
+  TheModule->IsNewDbgInfoFormat =
+      UseNewDbgInfoFormat &&
+      LoadBitcodeIntoNewDbgInforFormat == cl::boolOrDefault::BOU_TRUE;
----------------
CarlosAlbertoEnciso wrote:

As you check `LoadBitcodeIntoNewDbgInforFormat` only for `BOU_TRUE`, may be just define it as `cl::opt<cl::bool>`

https://github.com/llvm/llvm-project/pull/85649


More information about the llvm-commits mailing list