From efb5ad1c58e2fe758af3fd2a2f9a8c1196552864 Mon Sep 17 00:00:00 2001 From: Philip Pfaffe Date: Tue, 8 Jan 2019 14:06:58 +0000 Subject: [DA][NewPM] Add a printerpass and port the testsuite The new-pm version of DA is untested. Testing requires a printer, so add that and use it in the existing DA tests. Differential Revision: https://reviews.llvm.org/D56386 llvm-svn: 350624 --- llvm/lib/Analysis/DependenceAnalysis.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Analysis/DependenceAnalysis.cpp') diff --git a/llvm/lib/Analysis/DependenceAnalysis.cpp b/llvm/lib/Analysis/DependenceAnalysis.cpp index b544ae5f535..3f4dfa52e1d 100644 --- a/llvm/lib/Analysis/DependenceAnalysis.cpp +++ b/llvm/lib/Analysis/DependenceAnalysis.cpp @@ -194,6 +194,13 @@ void DependenceAnalysisWrapperPass::print(raw_ostream &OS, dumpExampleDependence(OS, info.get()); } +PreservedAnalyses +DependenceAnalysisPrinterPass::run(Function &F, FunctionAnalysisManager &FAM) { + OS << "'Dependence Analysis' for function '" << F.getName() << "':\n"; + dumpExampleDependence(OS, &FAM.getResult(F)); + return PreservedAnalyses::all(); +} + //===----------------------------------------------------------------------===// // Dependence methods -- cgit v1.2.3