1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Add new command line option

llvm-svn: 9754
This commit is contained in:
Chris Lattner 2003-11-06 20:29:25 +00:00
parent 8e2385eb4d
commit 1dd7f6c133

View File

@ -37,6 +37,9 @@ namespace {
cl::desc("Print LLVM code with frequency annotations")); cl::desc("Print LLVM code with frequency annotations"));
cl::alias PrintAnnotated2("A", cl::desc("Alias for --annotated-llvm"), cl::alias PrintAnnotated2("A", cl::desc("Alias for --annotated-llvm"),
cl::aliasopt(PrintAnnotatedLLVM)); 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. // 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()); BlockFreqs.insert(Counts.begin(), Counts.end());
} }
if (PrintAnnotatedLLVM) { if (PrintAnnotatedLLVM || PrintAllCode) {
std::cout << "\n===" << std::string(73, '-') << "===\n"; std::cout << "\n===" << std::string(73, '-') << "===\n";
std::cout << "Annotated LLVM code for the module:\n\n"; std::cout << "Annotated LLVM code for the module:\n\n";
ProfileAnnotator PA(FuncFreqs, BlockFreqs); ProfileAnnotator PA(FuncFreqs, BlockFreqs);
if (FunctionsToPrint.empty()) if (FunctionsToPrint.empty() || PrintAllCode)
M->print(std::cout, &PA); M->print(std::cout, &PA);
else else
// Print just a subset of the functions... // Print just a subset of the functions...