Add new command line option
authorChris Lattner <sabre@nondot.org>
Thu, 6 Nov 2003 20:29:25 +0000 (20:29 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 6 Nov 2003 20:29:25 +0000 (20:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9754 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-prof/llvm-prof.cpp

index 672e0f6922648208c20e698e2ec9aa60a4227b98..4492fd67b7196b1ddc88c0fb597488047cd938a0 100644 (file)
@@ -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...