diff options
Diffstat (limited to 'contrib/llvm-project/llvm/lib/IR/IRPrintingPasses.cpp')
-rw-r--r-- | contrib/llvm-project/llvm/lib/IR/IRPrintingPasses.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/contrib/llvm-project/llvm/lib/IR/IRPrintingPasses.cpp b/contrib/llvm-project/llvm/lib/IR/IRPrintingPasses.cpp index 78c2f192d2c0..b19210e776ed 100644 --- a/contrib/llvm-project/llvm/lib/IR/IRPrintingPasses.cpp +++ b/contrib/llvm-project/llvm/lib/IR/IRPrintingPasses.cpp @@ -39,6 +39,12 @@ public: ShouldPreserveUseListOrder(ShouldPreserveUseListOrder) {} bool runOnModule(Module &M) override { + // RemoveDIs: there's no textual representation of the DPValue debug-info, + // convert to dbg.values before writing out. + bool IsNewDbgInfoFormat = M.IsNewDbgInfoFormat; + if (IsNewDbgInfoFormat) + M.convertFromNewDbgValues(); + if (llvm::isFunctionInPrintList("*")) { if (!Banner.empty()) OS << Banner << "\n"; @@ -55,6 +61,10 @@ public: } } } + + if (IsNewDbgInfoFormat) + M.convertToNewDbgValues(); + return false; } @@ -77,6 +87,12 @@ public: // This pass just prints a banner followed by the function as it's processed. bool runOnFunction(Function &F) override { + // RemoveDIs: there's no textual representation of the DPValue debug-info, + // convert to dbg.values before writing out. + bool IsNewDbgInfoFormat = F.IsNewDbgInfoFormat; + if (IsNewDbgInfoFormat) + F.convertFromNewDbgValues(); + if (isFunctionInPrintList(F.getName())) { if (forcePrintModuleIR()) OS << Banner << " (function: " << F.getName() << ")\n" @@ -84,6 +100,10 @@ public: else OS << Banner << '\n' << static_cast<Value &>(F); } + + if (IsNewDbgInfoFormat) + F.convertToNewDbgValues(); + return false; } |