diff options
Diffstat (limited to 'tools/llvm-prof')
-rw-r--r-- | tools/llvm-prof/LLVMBuild.txt | 22 | ||||
-rw-r--r-- | tools/llvm-prof/Makefile | 6 | ||||
-rw-r--r-- | tools/llvm-prof/llvm-prof.cpp | 18 |
3 files changed, 34 insertions, 12 deletions
diff --git a/tools/llvm-prof/LLVMBuild.txt b/tools/llvm-prof/LLVMBuild.txt new file mode 100644 index 0000000..d59127c --- /dev/null +++ b/tools/llvm-prof/LLVMBuild.txt @@ -0,0 +1,22 @@ +;===- ./tools/llvm-prof/LLVMBuild.txt --------------------------*- Conf -*--===; +; +; The LLVM Compiler Infrastructure +; +; This file is distributed under the University of Illinois Open Source +; License. See LICENSE.TXT for details. +; +;===------------------------------------------------------------------------===; +; +; This is an LLVMBuild description file for the components in this subdirectory. +; +; For more information on the LLVMBuild system, please see: +; +; http://llvm.org/docs/LLVMBuild.html +; +;===------------------------------------------------------------------------===; + +[component_0] +type = Tool +name = llvm-prof +parent = Tools +required_libraries = Analysis BitReader diff --git a/tools/llvm-prof/Makefile b/tools/llvm-prof/Makefile index 86eb54d..f829786 100644 --- a/tools/llvm-prof/Makefile +++ b/tools/llvm-prof/Makefile @@ -6,10 +6,10 @@ # License. See LICENSE.TXT for details. # ##===----------------------------------------------------------------------===## -LEVEL = ../.. -TOOLNAME = llvm-prof -LINK_COMPONENTS = bitreader analysis +LEVEL := ../.. +TOOLNAME := llvm-prof +LINK_COMPONENTS := bitreader analysis # This tool has no plugins, optimize startup time. TOOL_NO_EXPORTS = 1 diff --git a/tools/llvm-prof/llvm-prof.cpp b/tools/llvm-prof/llvm-prof.cpp index 9d0b468..d9b6713 100644 --- a/tools/llvm-prof/llvm-prof.cpp +++ b/tools/llvm-prof/llvm-prof.cpp @@ -200,9 +200,9 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) { } outs() << format("%3d", i+1) << ". " - << format("%5.2g", FunctionCounts[i].second) << "/" - << format("%g", TotalExecutions) << " " - << FunctionCounts[i].first->getNameStr() << "\n"; + << format("%5.2g", FunctionCounts[i].second) << "/" + << format("%g", TotalExecutions) << " " + << FunctionCounts[i].first->getName() << "\n"; } std::set<Function*> FunctionsToPrint; @@ -225,12 +225,12 @@ bool ProfileInfoPrinterPass::runOnModule(Module &M) { for (unsigned i = 0; i != BlocksToPrint; ++i) { if (Counts[i].second == 0) break; Function *F = Counts[i].first->getParent(); - outs() << format("%3d", i+1) << ". " - << format("%5g", Counts[i].second/(double)TotalExecutions*100) << "% " - << format("%5.0f", Counts[i].second) << "/" - << format("%g", TotalExecutions) << "\t" - << F->getNameStr() << "() - " - << Counts[i].first->getNameStr() << "\n"; + outs() << format("%3d", i+1) << ". " + << format("%5g", Counts[i].second/(double)TotalExecutions*100)<<"% " + << format("%5.0f", Counts[i].second) << "/" + << format("%g", TotalExecutions) << "\t" + << F->getName() << "() - " + << Counts[i].first->getName() << "\n"; FunctionsToPrint.insert(F); } |