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.

llvm-svn: 176746
This commit is contained in:
Nick Lewycky 2013-03-09 01:33:12 +00:00
parent 88f1d0d64e
commit 593eeb000a
1 changed files with 7 additions and 3 deletions

View File

@ -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);
}