summaryrefslogtreecommitdiff
path: root/tools/llvm-prof
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-10-31 00:20:09 +0000
committerChris Lattner <sabre@nondot.org>2003-10-31 00:20:09 +0000
commit3b7f41631db5a63d6d48027aacd4c73b4fc336ae (patch)
treeb606b195814f7517a15aee9c3ec38796ad7c143b /tools/llvm-prof
parente1ccadf58cf71d8c2a975eb564ee1497ec508854 (diff)
downloadllvm-3b7f41631db5a63d6d48027aacd4c73b4fc336ae.tar.gz
llvm-3b7f41631db5a63d6d48027aacd4c73b4fc336ae.tar.bz2
llvm-3b7f41631db5a63d6d48027aacd4c73b4fc336ae.tar.xz
Simplify code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9625 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-prof')
-rw-r--r--tools/llvm-prof/llvm-prof.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index e9f6d99146..80eb36bd63 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -174,15 +174,15 @@ int main(int argc, char **argv) {
std::cout << "\n===" << std::string(73, '-') << "===\n";
std::cout << "Annotated LLVM code for the module:\n\n";
- if (FunctionsToPrint.empty())
- for (Module::iterator I = M->begin(), E = M->end(); I != E; ++I)
- FunctionsToPrint.insert(I);
-
ProfileAnnotator PA(FuncFreqs, BlockFreqs);
- for (std::set<Function*>::iterator I = FunctionsToPrint.begin(),
- E = FunctionsToPrint.end(); I != E; ++I)
- (*I)->print(std::cout, &PA);
+ if (FunctionsToPrint.empty())
+ M->print(std::cout, &PA);
+ else
+ // Print just a subset of the functions...
+ for (std::set<Function*>::iterator I = FunctionsToPrint.begin(),
+ E = FunctionsToPrint.end(); I != E; ++I)
+ (*I)->print(std::cout, &PA);
}
return 0;