[llvm] [RemoveDIs] Print non-intrinsic debug info in textual IR output (PR #79281)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 19 01:59:20 PST 2024


================
@@ -75,11 +78,10 @@ PrintFunctionPass::PrintFunctionPass(raw_ostream &OS, const std::string &Banner)
 
 PreservedAnalyses PrintFunctionPass::run(Function &F,
                                          FunctionAnalysisManager &) {
-  // RemoveDIs: there's no textual representation of the DPValue debug-info,
-  // convert to dbg.values before writing out.
-  bool ShouldConvert = F.IsNewDbgInfoFormat;
-  if (ShouldConvert)
-    F.convertFromNewDbgValues();
+  // RemoveDIs: Regardless of the format we've processed this function in, use
+  // `WriteNewDbgInfoFormat` to determine which format we use to write it.
+  bool UsedNewDbgInfoFormat = F.IsNewDbgInfoFormat;
+  F.setIsNewDbgInfoFormat(WriteNewDbgInfoFormat);
----------------
SLTozer wrote:

Done - I chose to keep the comments where they are and pass WriteNewDbgInfoFormat into the constructor rather than folding the comments and variable into the class, just because these are temporary insertions (until we turn off printing the old format) and the behaviour is non-obvious without the comment+variable imo - if you disagree then I can adjust it.

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


More information about the llvm-commits mailing list