diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-02-27 06:22:56 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-02-27 06:22:56 +0000 |
commit | 6fd43e40716775dd3ccfb646e48c719082c74ffb (patch) | |
tree | 6c05a8af27a29efdaff800811937f51729746548 /llvm/runtime/libprofile/GCDAProfiling.c | |
parent | 625f3956632dfa940b08afe562fb4a9f732bf7fa (diff) | |
download | bcm5719-llvm-6fd43e40716775dd3ccfb646e48c719082c74ffb.tar.gz bcm5719-llvm-6fd43e40716775dd3ccfb646e48c719082c74ffb.zip |
In GCC 4.7, function names are now forbidden from .gcda files. Support this by
passing a null pointer to the function name in to GCDAProfiling, and add another
switch onto GCOVProfiling.
llvm-svn: 176173
Diffstat (limited to 'llvm/runtime/libprofile/GCDAProfiling.c')
-rw-r--r-- | llvm/runtime/libprofile/GCDAProfiling.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/runtime/libprofile/GCDAProfiling.c b/llvm/runtime/libprofile/GCDAProfiling.c index f2dc4f79881..d9f3b326389 100644 --- a/llvm/runtime/libprofile/GCDAProfiling.c +++ b/llvm/runtime/libprofile/GCDAProfiling.c @@ -162,17 +162,22 @@ void llvm_gcda_increment_indirect_counter(uint32_t *predecessor, void llvm_gcda_emit_function(uint32_t ident, const char *function_name) { #ifdef DEBUG_GCDAPROFILING - printf("llvmgcda: function id=%x\n", ident); + printf("llvmgcda: function id=%x name=%s\n", ident, + function_name ? function_name : "NULL"); #endif if (!output_file) return; /* function tag */ fwrite("\0\0\0\1", 4, 1, output_file); - write_int32(3 + 1 + length_of_string(function_name)); + uint32_t len = 3; + if (function_name) + len += 1 + length_of_string(function_name); + write_int32(len); write_int32(ident); write_int32(0); write_int32(0); - write_string(function_name); + if (function_name) + write_string(function_name); } void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) { |