================ @@ -77,36 +78,68 @@ class LiveDebugValues : public MachineFunctionPass { AU.setPreservesCFG(); MachineFunctionPass::getAnalysisUsage(AU); } +}; + +struct LiveDebugValues { + LiveDebugValues(); + ~LiveDebugValues() = default; + bool run(MachineFunction &MF, bool ShouldEmitDebugEntryValues); private: std::unique_ptr<LDVImpl> InstrRefImpl; std::unique_ptr<LDVImpl> VarLocImpl; - TargetPassConfig *TPC = nullptr; MachineDominatorTree MDT; }; } // namespace -char LiveDebugValues::ID = 0; +char LiveDebugValuesLegacy::ID = 0; -char &llvm::LiveDebugValuesID = LiveDebugValues::ID; +char &llvm::LiveDebugValuesID = LiveDebugValuesLegacy::ID; -INITIALIZE_PASS(LiveDebugValues, DEBUG_TYPE, "Live DEBUG_VALUE analysis", false, - false) +INITIALIZE_PASS(LiveDebugValuesLegacy, DEBUG_TYPE, "Live DEBUG_VALUE analysis", + false, false) /// Default construct and initialize the pass. -LiveDebugValues::LiveDebugValues() : MachineFunctionPass(ID) { - initializeLiveDebugValuesPass(*PassRegistry::getPassRegistry()); +LiveDebugValuesLegacy::LiveDebugValuesLegacy() : MachineFunctionPass(ID) { + initializeLiveDebugValuesLegacyPass(*PassRegistry::getPassRegistry()); +} + +LiveDebugValues::LiveDebugValues() { InstrRefImpl = std::unique_ptr<LDVImpl>(llvm::makeInstrRefBasedLiveDebugValues()); VarLocImpl = std::unique_ptr<LDVImpl>(llvm::makeVarLocBasedLiveDebugValues()); } -bool LiveDebugValues::runOnMachineFunction(MachineFunction &MF) { +PreservedAnalyses +LiveDebugValuesPass::run(MachineFunction &MF, + MachineFunctionAnalysisManager &MFAM) { + if (!LiveDebugValues().run(MF, ShouldEmitDebugEntryValues)) + return PreservedAnalyses::all(); + auto PA = getMachineFunctionPassPreservedAnalyses(); ---------------- arsenm wrote:
I would hope this preserves everything https://github.com/llvm/llvm-project/pull/131563 _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits