diff options
author | Nick Lewycky <nicholas@mxc.ca> | 2013-03-09 01:33:12 +0000 |
---|---|---|
committer | Nick Lewycky <nicholas@mxc.ca> | 2013-03-09 01:33:12 +0000 |
commit | 07020829d181dcd352ff6f01eab4d353c37a19b6 (patch) | |
tree | 84ef32810c4af4310e7781fdc2e5b3ed63901a42 /lib/profile/GCDAProfiling.c | |
parent | 42296c7b5d69e6d79390005b6e1861ca66e3a0cb (diff) | |
download | compiler-rt-07020829d181dcd352ff6f01eab4d353c37a19b6.tar.gz |
Don't emit the extra checksum into the .gcda file if the user hasn't asked for
it. Fortunately, versions of gcov that predate the extra checksum also ignore
any extra data, so this isn't a problem. This matches the API change made in
r176745.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176746 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/profile/GCDAProfiling.c')
-rw-r--r-- | lib/profile/GCDAProfiling.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/profile/GCDAProfiling.c b/lib/profile/GCDAProfiling.c index b4f07fbe8..c7f74fd90 100644 --- a/lib/profile/GCDAProfiling.c +++ b/lib/profile/GCDAProfiling.c @@ -203,8 +203,11 @@ void llvm_gcda_increment_indirect_counter(uint32_t *predecessor, #endif } -void llvm_gcda_emit_function(uint32_t ident, const char *function_name) { - uint32_t len = 3; +void llvm_gcda_emit_function(uint32_t ident, const char *function_name, + uint8_t use_extra_checksum) { + uint32_t len = 2; + if (use_extra_checksum) + len++; #ifdef DEBUG_GCDAPROFILING fprintf(stderr, "llvmgcda: function id=0x%08x name=%s\n", ident, function_name ? function_name : "NULL"); @@ -218,7 +221,8 @@ void llvm_gcda_emit_function(uint32_t ident, const char *function_name) { write_int32(len); write_int32(ident); write_int32(0); - write_int32(0); + if (use_extra_checksum) + write_int32(0); if (function_name) write_string(function_name); } |