diff options
Diffstat (limited to 'llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h')
-rw-r--r-- | llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h index 1572a49e3384..eb48ec3af526 100644 --- a/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h +++ b/llvm/include/llvm/Analysis/ModuleSummaryAnalysis.h @@ -25,6 +25,7 @@ class BlockFrequencyInfo; class Function; class Module; class ProfileSummaryInfo; +class StackSafetyInfo; /// Direct function to compute a \c ModuleSummaryIndex from a given module. /// @@ -35,7 +36,9 @@ class ProfileSummaryInfo; ModuleSummaryIndex buildModuleSummaryIndex( const Module &M, std::function<BlockFrequencyInfo *(const Function &F)> GetBFICallback, - ProfileSummaryInfo *PSI); + ProfileSummaryInfo *PSI, + std::function<const StackSafetyInfo *(const Function &F)> GetSSICallback = + [](const Function &F) -> const StackSafetyInfo * { return nullptr; }); /// Analysis pass to provide the ModuleSummaryIndex object. class ModuleSummaryIndexAnalysis @@ -75,6 +78,27 @@ public: // ModulePass *createModuleSummaryIndexWrapperPass(); +/// Legacy wrapper pass to provide the ModuleSummaryIndex object. +class ImmutableModuleSummaryIndexWrapperPass : public ImmutablePass { + const ModuleSummaryIndex *Index; + +public: + static char ID; + + ImmutableModuleSummaryIndexWrapperPass( + const ModuleSummaryIndex *Index = nullptr); + const ModuleSummaryIndex *getIndex() const { return Index; } + void getAnalysisUsage(AnalysisUsage &AU) const override; +}; + +//===--------------------------------------------------------------------===// +// +// ImmutableModuleSummaryIndexWrapperPass - This pass wrap provided +// ModuleSummaryIndex object for the module, to be used by other passes. +// +ImmutablePass * +createImmutableModuleSummaryIndexWrapperPass(const ModuleSummaryIndex *Index); + } // end namespace llvm #endif // LLVM_ANALYSIS_MODULESUMMARYANALYSIS_H |