From a36f81a3eafaff7c43412bfcad80a3f40cd0cd2f Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Fri, 31 Oct 2003 00:20:09 +0000 Subject: [PATCH] Simplify code llvm-svn: 9625 --- llvm/tools/llvm-prof/llvm-prof.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/llvm/tools/llvm-prof/llvm-prof.cpp b/llvm/tools/llvm-prof/llvm-prof.cpp index e9f6d991462c..80eb36bd63d8 100644 --- a/llvm/tools/llvm-prof/llvm-prof.cpp +++ b/llvm/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::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::iterator I = FunctionsToPrint.begin(), + E = FunctionsToPrint.end(); I != E; ++I) + (*I)->print(std::cout, &PA); } return 0;