From 42296c7b5d69e6d79390005b6e1861ca66e3a0cb 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176618 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/profile/GCDAProfiling.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'lib/profile/GCDAProfiling.c') diff --git a/lib/profile/GCDAProfiling.c b/lib/profile/GCDAProfiling.c index 96e9fc2b7..b4f07fbe8 100644 --- a/lib/profile/GCDAProfiling.c +++ b/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