From 5b1c70a48d97513563ced9f39c631f302c071c75 Mon Sep 17 00:00:00 2001 From: Vitaly Buka Date: Tue, 2 Jun 2020 01:19:57 -0700 Subject: [StackSafety] Pass summary into codegen Summary: The patch wraps ThinLTO index into immutable pass which can be used by StackSafety analysis. Reviewers: eugenis, pcc Reviewed By: eugenis Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D80985 --- llvm/lib/Analysis/ModuleSummaryAnalysis.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'llvm/lib/Analysis/ModuleSummaryAnalysis.cpp') diff --git a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp index 9950798..e7d529d 100644 --- a/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp +++ b/llvm/lib/Analysis/ModuleSummaryAnalysis.cpp @@ -909,3 +909,25 @@ void ModuleSummaryIndexWrapperPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired(); AU.addRequired(); } + +char ImmutableModuleSummaryIndexWrapperPass::ID = 0; + +ImmutableModuleSummaryIndexWrapperPass::ImmutableModuleSummaryIndexWrapperPass( + const ModuleSummaryIndex *Index) + : ImmutablePass(ID), Index(Index) { + initializeImmutableModuleSummaryIndexWrapperPassPass( + *PassRegistry::getPassRegistry()); +} + +void ImmutableModuleSummaryIndexWrapperPass::getAnalysisUsage( + AnalysisUsage &AU) const { + AU.setPreservesAll(); +} + +ImmutablePass *llvm::createImmutableModuleSummaryIndexWrapperPass( + const ModuleSummaryIndex *Index) { + return new ImmutableModuleSummaryIndexWrapperPass(Index); +} + +INITIALIZE_PASS(ImmutableModuleSummaryIndexWrapperPass, "module-summary-info", + "Module summary info", false, true) -- cgit v1.1