summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-prof/llvm-prof.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-09-02 23:07:12 +0000
committerChris Lattner <sabre@nondot.org>2010-09-02 23:07:12 +0000
commit82570a04df8a1073553298446498c3b21771d511 (patch)
tree4f56b946bade93d45fe5bd52abae969ddcaadc79 /llvm/tools/llvm-prof/llvm-prof.cpp
parenta5a645559c26b5d174cb713992f829ab2be09630 (diff)
downloadbcm5719-llvm-82570a04df8a1073553298446498c3b21771d511.tar.gz
bcm5719-llvm-82570a04df8a1073553298446498c3b21771d511.zip
AsmPrinter has a formatted stream, pass it down through AsmAnnotationWriter
llvm-svn: 112903
Diffstat (limited to 'llvm/tools/llvm-prof/llvm-prof.cpp')
-rw-r--r--llvm/tools/llvm-prof/llvm-prof.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp
index 0c6c4d7bb78..aff5b86a8a8 100644
--- a/llvm/tools/llvm-prof/llvm-prof.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud