[compiler-rt] r176746 - Don't emit the extra checksum into the .gcda file if the user hasn't asked for

Nick Lewycky nicholas at mxc.ca
Fri Mar 8 17:33:13 PST 2013


Author: nicholas
Date: Fri Mar  8 19:33:12 2013
New Revision: 176746

URL: http://llvm.org/viewvc/llvm-project?rev=176746&view=rev
Log:
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.

Modified:
    compiler-rt/trunk/lib/profile/GCDAProfiling.c

Modified: compiler-rt/trunk/lib/profile/GCDAProfiling.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/GCDAProfiling.c?rev=176746&r1=176745&r2=176746&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/GCDAProfiling.c (original)
+++ compiler-rt/trunk/lib/profile/GCDAProfiling.c Fri Mar  8 19:33:12 2013
@@ -203,8 +203,11 @@ void llvm_gcda_increment_indirect_counte
 #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 id
   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);
 }





More information about the llvm-commits mailing list