From 53caba6cc23a9c95e2190bc3fc90646a5d09be5d Mon Sep 17 00:00:00 2001 From: Bill Wendling Date: Fri, 25 May 2012 21:57:59 +0000 Subject: [PATCH] Small code cleanup. No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157502 91177308-0d34-0410-b5e6-96231b3b80d8 --- runtime/libprofile/GCDAProfiling.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/runtime/libprofile/GCDAProfiling.c b/runtime/libprofile/GCDAProfiling.c index 32d19ad7742..b01b948142a 100644 --- a/runtime/libprofile/GCDAProfiling.c +++ b/runtime/libprofile/GCDAProfiling.c @@ -43,10 +43,8 @@ static void write_int32(uint32_t i) { } static void write_int64(uint64_t i) { - uint32_t lo, hi; - lo = i >> 0; - hi = i >> 32; - + uint32_t lo = i >> 0; + uint32_t hi = i >> 32; write_int32(lo); write_int32(hi); } @@ -76,7 +74,6 @@ static char *mangle_filename(const char *orig_filename) { strcpy(filename, prefix); strcat(filename, "/"); strcat(filename, orig_filename); - return filename; } @@ -184,15 +181,13 @@ void llvm_gcda_emit_arcs(uint32_t num_counters, uint64_t *counters) { if (!output_file) return; fwrite("\0\0\xa1\1", 4, 1, output_file); write_int32(num_counters * 2); - for (i = 0; i < num_counters; ++i) { + for (i = 0; i < num_counters; ++i) write_int64(counters[i]); - } #ifdef DEBUG_GCDAPROFILING printf("llvmgcda: %u arcs\n", num_counters); - for (i = 0; i < num_counters; ++i) { + for (i = 0; i < num_counters; ++i) printf("llvmgcda: %llu\n", (unsigned long long)counters[i]); - } #endif }