From 64dbb295b69aaf9ac9fbeab7ebf56ea84d87b19d Mon Sep 17 00:00:00 2001 From: Xinliang David Li Date: Sun, 5 Jun 2016 05:12:23 +0000 Subject: [PM] Port GCOVProfiler pass to the new pass manager llvm-svn: 271823 --- llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'llvm/lib/Transforms') diff --git a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp index f7ace857a37..9b19833cb75 100644 --- a/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp +++ b/llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp @@ -14,7 +14,6 @@ // //===----------------------------------------------------------------------===// -#include "llvm/Transforms/Instrumentation.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/Hashing.h" #include "llvm/ADT/STLExtras.h" @@ -35,6 +34,8 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/raw_ostream.h" +#include "llvm/Transforms/GCOVProfiler.h" +#include "llvm/Transforms/Instrumentation.h" #include "llvm/Transforms/Utils/ModuleUtils.h" #include #include @@ -464,6 +465,17 @@ bool GCOVProfiler::runOnModule(Module &M) { return false; } +PreservedAnalyses GCOVProfilerPass::run(Module &M, + AnalysisManager &AM) { + + GCOVProfiler Profiler(GCOVOpts); + + if (!Profiler.runOnModule(M)) + return PreservedAnalyses::all(); + + return PreservedAnalyses::none(); +} + static bool functionHasLines(Function &F) { // Check whether this function actually has any source lines. Not only // do these waste space, they also can crash gcov. -- cgit v1.2.3