summaryrefslogtreecommitdiff
path: root/tools/llvm-prof
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-06 20:29:25 +0000
committerChris Lattner <sabre@nondot.org>2003-11-06 20:29:25 +0000
commitcde1cf3f9dccb42f546dcc4ca7d5f96abea0b050 (patch)
treef13a682beaaf4046ecc93ea50f8c4d99dc275ec6 /tools/llvm-prof
parent0c7e8e17ff602d473d9ea0f91b246365dcc6fe30 (diff)
downloadllvm-cde1cf3f9dccb42f546dcc4ca7d5f96abea0b050.tar.gz
llvm-cde1cf3f9dccb42f546dcc4ca7d5f96abea0b050.tar.bz2
llvm-cde1cf3f9dccb42f546dcc4ca7d5f96abea0b050.tar.xz
Add new command line option
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9754 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/llvm-prof')
-rw-r--r--tools/llvm-prof/llvm-prof.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp
index 672e0f6922..4492fd67b7 100644
--- a/tools/llvm-prof/llvm-prof.cpp
+++ b/tools/llvm-prof/llvm-prof.cpp
@@ -37,6 +37,9 @@ namespace {
cl::desc("Print LLVM code with frequency annotations"));
cl::alias PrintAnnotated2("A", cl::desc("Alias for --annotated-llvm"),
cl::aliasopt(PrintAnnotatedLLVM));
+ cl::opt<bool>
+ PrintAllCode("print-all-code",
+ cl::desc("Print annotated code for the entire program"));
}
// PairSecondSort - A sorting predicate to sort by the second element of a pair.
@@ -171,13 +174,13 @@ int main(int argc, char **argv) {
BlockFreqs.insert(Counts.begin(), Counts.end());
}
- if (PrintAnnotatedLLVM) {
+ if (PrintAnnotatedLLVM || PrintAllCode) {
std::cout << "\n===" << std::string(73, '-') << "===\n";
std::cout << "Annotated LLVM code for the module:\n\n";
ProfileAnnotator PA(FuncFreqs, BlockFreqs);
- if (FunctionsToPrint.empty())
+ if (FunctionsToPrint.empty() || PrintAllCode)
M->print(std::cout, &PA);
else
// Print just a subset of the functions...