diff options
author | Chris Lattner <sabre@nondot.org> | 2010-09-02 23:07:12 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-09-02 23:07:12 +0000 |
commit | a11a6a0abb0f09c5a381a7bb49901710a7b260f1 (patch) | |
tree | d73d055d44a861581e1118a5f1a12b9eb4fabc41 /tools/llvm-prof | |
parent | ace53f2fbc65f1e26c084c733ffbdbe3516580a6 (diff) |
AsmPrinter has a formatted stream, pass it down through AsmAnnotationWriter
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-prof')
-rw-r--r-- | tools/llvm-prof/llvm-prof.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp index 0c6c4d7bb7..aff5b86a8a 100644 --- a/tools/llvm-prof/llvm-prof.cpp +++ b/tools/llvm-prof/llvm-prof.cpp @@ -23,6 +23,7 @@ #include "llvm/Analysis/Passes.h" #include "llvm/Bitcode/ReaderWriter.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/FormattedStream.h" #include "llvm/Support/ManagedStatic.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/PrettyStackTrace.h" @@ -75,9 +76,10 @@ namespace { class ProfileAnnotator : public AssemblyAnnotationWriter { ProfileInfo &PI; public: - ProfileAnnotator(ProfileInfo& pi) : PI(pi) {} + ProfileAnnotator(ProfileInfo &pi) : PI(pi) {} - virtual void emitFunctionAnnot(const Function *F, raw_ostream &OS) { + virtual void emitFunctionAnnot(const Function *F, + formatted_raw_ostream &OS) { double w = PI.getExecutionCount(F); if (w != ProfileInfo::MissingValue) { OS << ";;; %" << F->getName() << " called "<<(unsigned)w @@ -85,7 +87,7 @@ namespace { } } virtual void emitBasicBlockStartAnnot(const BasicBlock *BB, - raw_ostream &OS) { + formatted_raw_ostream &OS) { double w = PI.getExecutionCount(BB); if (w != ProfileInfo::MissingValue) { if (w != 0) { @@ -96,7 +98,8 @@ namespace { } } - virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, raw_ostream &OS) { + virtual void emitBasicBlockEndAnnot(const BasicBlock *BB, + formatted_raw_ostream &OS) { // Figure out how many times each successor executed. std::vector<std::pair<ProfileInfo::Edge, double> > SuccCounts; |