summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
diff options
context:
space:
mode:
authorNick Lewycky <nicholas@mxc.ca>2011-04-12 01:06:09 +0000
committerNick Lewycky <nicholas@mxc.ca>2011-04-12 01:06:09 +0000
commit9d60e373cfc5189f129a30c09189c9e8a50423f9 (patch)
treeac74d750426a15fcd116b7a37c584860d5d901ea /llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
parent8e93666a710e8ffa9c762314c1f4f39ac7410f9f (diff)
downloadbcm5719-llvm-9d60e373cfc5189f129a30c09189c9e8a50423f9.tar.gz
bcm5719-llvm-9d60e373cfc5189f129a30c09189c9e8a50423f9.zip
Add support for line profiling. Very work-in-progress.
Use debug info in the IR to find the directory/file:line:col. Each time that location changes, bump a counter. Unlike the existing profiling system, we don't try to look at argv[], and thusly don't require main() to be present in the IR. This matches GCC's technique where you specify the profiling flag when producing each .o file. The runtime library is minimal, currently just calling printf at program shutdown time. The API is designed to make it possible to emit GCOV data later on. llvm-svn: 129340
Diffstat (limited to 'llvm/lib/Transforms/Instrumentation/Instrumentation.cpp')
-rw-r--r--llvm/lib/Transforms/Instrumentation/Instrumentation.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
index 96ed4fa5c0f..b299bb71a4a 100644
--- a/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
+++ b/llvm/lib/Transforms/Instrumentation/Instrumentation.cpp
@@ -23,6 +23,7 @@ void llvm::initializeInstrumentation(PassRegistry &Registry) {
initializeEdgeProfilerPass(Registry);
initializeOptimalEdgeProfilerPass(Registry);
initializePathProfilerPass(Registry);
+ initializeLineProfilerPass(Registry);
}
/// LLVMInitializeInstrumentation - C binding for
OpenPOWER on IntegriCloud