diff options
author | Xinliang David Li <davidxl@google.com> | 2016-06-05 05:12:23 +0000 |
---|---|---|
committer | Xinliang David Li <davidxl@google.com> | 2016-06-05 05:12:23 +0000 |
commit | 64dbb295b69aaf9ac9fbeab7ebf56ea84d87b19d (patch) | |
tree | 0b45dc30bd0d8e4be42b49cd4a20985ec3c07101 /llvm/lib/Transforms | |
parent | fb3137c3b3263ce785a442ce35a117c88f98c428 (diff) | |
download | bcm5719-llvm-64dbb295b69aaf9ac9fbeab7ebf56ea84d87b19d.tar.gz bcm5719-llvm-64dbb295b69aaf9ac9fbeab7ebf56ea84d87b19d.zip |
[PM] Port GCOVProfiler pass to the new pass manager
llvm-svn: 271823
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Instrumentation/GCOVProfiling.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
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 <algorithm> #include <memory> @@ -464,6 +465,17 @@ bool GCOVProfiler::runOnModule(Module &M) { return false; } +PreservedAnalyses GCOVProfilerPass::run(Module &M, + AnalysisManager<Module> &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. |