From 8015c6ee2fd5e8daa6be0af02da1ccacb1120334 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Thu, 7 Mar 2013 08:28:54 +0000 Subject: Take the GCDA version string as an input to llvm_gcda_start_file. llvm-svn: 176618 --- compiler-rt/lib/profile/GCDAProfiling.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'compiler-rt/lib/profile') diff --git a/compiler-rt/lib/profile/GCDAProfiling.c b/compiler-rt/lib/profile/GCDAProfiling.c index 96e9fc2b7ff..b4f07fbe824 100644 --- a/compiler-rt/lib/profile/GCDAProfiling.c +++ b/compiler-rt/lib/profile/GCDAProfiling.c @@ -145,7 +145,7 @@ static void recursive_mkdir(char *filename) { * profiling enabled will emit to a different file. Only one file may be * started at a time. */ -void llvm_gcda_start_file(const char *orig_filename) { +void llvm_gcda_start_file(const char *orig_filename, const char version[4]) { char *filename = mangle_filename(orig_filename); /* Try just opening the file. */ @@ -167,13 +167,10 @@ void llvm_gcda_start_file(const char *orig_filename) { } } - /* gcda file, version 404*, stamp LLVM. */ -#ifdef __APPLE__ - fwrite("adcg*204MVLL", 12, 1, output_file); -#else - fwrite("adcg*404MVLL", 12, 1, output_file); -#endif - + /* gcda file, version, stamp LLVM. */ + fwrite("adcg", 4, 1, output_file); + fwrite(version, 4, 1, output_file); + fwrite("MVLL", 4, 1, output_file); free(filename); #ifdef DEBUG_GCDAPROFILING -- cgit v1.2.3