[llvm] [DebugInfo][RemoveDIs] Add flag to use "new" debug-info in opt (PR #71937)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 08:33:25 PST 2023


================
@@ -438,6 +444,19 @@ int main(int argc, char **argv) {
   initializeReplaceWithVeclibLegacyPass(Registry);
   initializeJMCInstrumenterPass(Registry);
 
+  // RemoveDIs debug-info transition: tests may request that we /try/ to use the
+  // new debug-info format, if it's built in.
+  if (TryUseNewDbgInfoFormat) {
+#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
+    // If LLVM was built with support for this, turn the new debug-info format
+    // on.
+    UseNewDbgInfoFormat = true;
+#else
+    // It it wasn't, do nothing.
+    ;
+#endif
+  }
----------------
OCHyams wrote:

```suggestion
  // RemoveDIs debug-info transition: tests may request that we /try/ to use the
  // new debug-info format, if it's built in.
#ifdef EXPERIMENTAL_DEBUGINFO_ITERATORS
  if (TryUseNewDbgInfoFormat)
    UseNewDbgInfoFormat = true;
#endif
  }
```

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


More information about the llvm-commits mailing list