From e94b59ee75b2bbef330d4ea9d06e87b51ddfd0e3 Mon Sep 17 00:00:00 2001 From: Arthur Eubanks Date: Wed, 15 Mar 2023 11:45:25 -0700 Subject: [PATCH] [Debugify/Strip] Fix returned PreservedAnalyses --- llvm/lib/Transforms/IPO/StripSymbols.cpp | 16 ++++++++++++---- llvm/lib/Transforms/Utils/Debugify.cpp | 4 +++- llvm/lib/Transforms/Utils/StripNonLineTableDebugInfo.cpp | 4 +++- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Transforms/IPO/StripSymbols.cpp b/llvm/lib/Transforms/IPO/StripSymbols.cpp index 03bc4f3..5ad7118 100644 --- a/llvm/lib/Transforms/IPO/StripSymbols.cpp +++ b/llvm/lib/Transforms/IPO/StripSymbols.cpp @@ -265,23 +265,31 @@ static bool stripDeadDebugInfoImpl(Module &M) { PreservedAnalyses StripSymbolsPass::run(Module &M, ModuleAnalysisManager &AM) { StripDebugInfo(M); StripSymbolNames(M, false); - return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet(); + return PA; } PreservedAnalyses StripNonDebugSymbolsPass::run(Module &M, ModuleAnalysisManager &AM) { StripSymbolNames(M, true); - return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet(); + return PA; } PreservedAnalyses StripDebugDeclarePass::run(Module &M, ModuleAnalysisManager &AM) { stripDebugDeclareImpl(M); - return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet(); + return PA; } PreservedAnalyses StripDeadDebugInfoPass::run(Module &M, ModuleAnalysisManager &AM) { stripDeadDebugInfoImpl(M); - return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet(); + return PA; } diff --git a/llvm/lib/Transforms/Utils/Debugify.cpp b/llvm/lib/Transforms/Utils/Debugify.cpp index 8e10a91..5a310db 100644 --- a/llvm/lib/Transforms/Utils/Debugify.cpp +++ b/llvm/lib/Transforms/Utils/Debugify.cpp @@ -979,7 +979,9 @@ PreservedAnalyses NewPMDebugifyPass::run(Module &M, ModuleAnalysisManager &) { collectDebugInfoMetadata(M, M.functions(), *DebugInfoBeforePass, "ModuleDebugify (original debuginfo)", NameOfWrappedPass); - return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet(); + return PA; } ModulePass *createCheckDebugifyModulePass( diff --git a/llvm/lib/Transforms/Utils/StripNonLineTableDebugInfo.cpp b/llvm/lib/Transforms/Utils/StripNonLineTableDebugInfo.cpp index 01aa6d1..65b5402 100644 --- a/llvm/lib/Transforms/Utils/StripNonLineTableDebugInfo.cpp +++ b/llvm/lib/Transforms/Utils/StripNonLineTableDebugInfo.cpp @@ -17,5 +17,7 @@ using namespace llvm; PreservedAnalyses StripNonLineTableDebugInfoPass::run(Module &M, ModuleAnalysisManager &AM) { llvm::stripNonLineTableDebugInfo(M); - return PreservedAnalyses::all(); + PreservedAnalyses PA; + PA.preserveSet(); + return PA; } -- 2.7.4