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

Paul T Robinson via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 10 08:46:56 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
+  }
----------------
pogo59 wrote:

@OCHyams might need a `(void)TryUseNewDbgInfoFormat;` to suppress an unused-variable warning in the iterators-off mode.

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


More information about the llvm-commits mailing list