[compiler-rt] r206915 - [profile] Flatten profile runtime - define platform-specific code in sources, not in the build system

Alexey Samsonov samsonov at google.com
Tue Apr 22 11:49:33 PDT 2014


Author: samsonov
Date: Tue Apr 22 13:49:32 2014
New Revision: 206915

URL: http://llvm.org/viewvc/llvm-project?rev=206915&view=rev
Log:
[profile] Flatten profile runtime - define platform-specific code in sources, not in the build system

Modified:
    compiler-rt/trunk/lib/profile/CMakeLists.txt
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c

Modified: compiler-rt/trunk/lib/profile/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/CMakeLists.txt?rev=206915&r1=206914&r2=206915&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/profile/CMakeLists.txt Tue Apr 22 13:49:32 2014
@@ -1,27 +1,20 @@
 add_custom_target(profile)
 
-if(APPLE)
-  set(PROFILE_SOURCES
-    GCDAProfiling.c
-    InstrProfiling.c
-    InstrProfilingBuffer.c
-    InstrProfilingFile.c
-    InstrProfilingPlatformDarwin.c
-    InstrProfilingRuntime.cc)
+set(PROFILE_SOURCES
+  GCDAProfiling.c
+  InstrProfiling.c
+  InstrProfilingBuffer.c
+  InstrProfilingFile.c
+  InstrProfilingPlatformDarwin.c
+  InstrProfilingPlatformOther.c
+  InstrProfilingRuntime.cc)
 
+if(APPLE)
   add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
     ARCH ${PROFILE_SUPPORTED_ARCH}
     SOURCES ${PROFILE_SOURCES})
   add_dependencies(profile clang_rt.profile_osx)
 else()
-  set(PROFILE_SOURCES
-    GCDAProfiling.c
-    InstrProfiling.c
-    InstrProfilingBuffer.c
-    InstrProfilingFile.c
-    InstrProfilingPlatformOther.c
-    InstrProfilingRuntime.cc)
-
   foreach(arch ${PROFILE_SUPPORTED_ARCH})
     add_compiler_rt_runtime(clang_rt.profile-${arch} ${arch} STATIC
       SOURCES ${PROFILE_SOURCES})

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c?rev=206915&r1=206914&r2=206915&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c Tue Apr 22 13:49:32 2014
@@ -9,6 +9,7 @@
 
 #include "InstrProfiling.h"
 
+#if defined(__APPLE__)
 /* Use linker magic to find the bounds of the Data section. */
 extern __llvm_profile_data DataStart __asm("section$start$__DATA$__llvm_prf_data");
 extern __llvm_profile_data DataEnd   __asm("section$end$__DATA$__llvm_prf_data");
@@ -27,3 +28,4 @@ const char *__llvm_profile_names_begin(v
 const char *__llvm_profile_names_end(void) { return &NamesEnd; }
 uint64_t *__llvm_profile_counters_begin(void) { return &CountersStart; }
 uint64_t *__llvm_profile_counters_end(void) { return &CountersEnd; }
+#endif

Modified: compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c?rev=206915&r1=206914&r2=206915&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c Tue Apr 22 13:49:32 2014
@@ -8,6 +8,8 @@
 \*===----------------------------------------------------------------------===*/
 
 #include "InstrProfiling.h"
+
+#if !defined(__APPLE__)
 #include <stdlib.h>
 
 static const __llvm_profile_data *DataFirst = NULL;
@@ -62,3 +64,4 @@ const char *__llvm_profile_names_begin(v
 const char *__llvm_profile_names_end(void) { return NamesLast; }
 uint64_t *__llvm_profile_counters_begin(void) { return CountersFirst; }
 uint64_t *__llvm_profile_counters_end(void) { return CountersLast; }
+#endif





More information about the llvm-commits mailing list