[compiler-rt] r204373 - PGO: Moving files for clarity

Duncan P. N. Exon Smith dexonsmith at apple.com
Thu Mar 20 11:43:09 PDT 2014


Author: dexonsmith
Date: Thu Mar 20 13:43:09 2014
New Revision: 204373

URL: http://llvm.org/viewvc/llvm-project?rev=204373&view=rev
Log:
PGO: Moving files for clarity

<rdar://problem/15943240>

Added:
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c
      - copied, changed from r204347, compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c
    compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c
      - copied, changed from r204347, compiler-rt/trunk/lib/profile/InstrProfilingDefault.c
Removed:
    compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c
    compiler-rt/trunk/lib/profile/InstrProfilingDefault.c
Modified:
    compiler-rt/trunk/lib/profile/CMakeLists.txt
    compiler-rt/trunk/make/platform/clang_darwin.mk

Modified: compiler-rt/trunk/lib/profile/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/CMakeLists.txt?rev=204373&r1=204372&r2=204373&view=diff
==============================================================================
--- compiler-rt/trunk/lib/profile/CMakeLists.txt (original)
+++ compiler-rt/trunk/lib/profile/CMakeLists.txt Thu Mar 20 13:43:09 2014
@@ -6,7 +6,7 @@ if(APPLE)
   set(PROFILE_SOURCES
     GCDAProfiling.c
     InstrProfiling.c
-    InstrProfilingDarwin.c
+    InstrProfilingPlatformDarwin.c
     InstrProfilingExtras.c)
 
   add_compiler_rt_osx_static_runtime(clang_rt.profile_osx
@@ -17,7 +17,7 @@ else()
   set(PROFILE_SOURCES
     GCDAProfiling.c
     InstrProfiling.c
-    InstrProfilingDefault.c
+    InstrProfilingPlatformOther.c
     InstrProfilingExtras.c)
 
   foreach(arch ${PROFILE_SUPPORTED_ARCH})

Removed: compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c?rev=204372&view=auto
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c (removed)
@@ -1,25 +0,0 @@
-/*===- InstrProfilingDarwin.c - Profile data on Darwin --------------------===*\
-|*
-|*                     The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "InstrProfiling.h"
-
-/* Use linker magic to find the bounds of the Data section. */
-extern __llvm_pgo_data DataStart __asm("section$start$__DATA$__llvm_pgo_data");
-extern __llvm_pgo_data DataEnd   __asm("section$end$__DATA$__llvm_pgo_data");
-extern char NamesStart __asm("section$start$__DATA$__llvm_pgo_names");
-extern char NamesEnd   __asm("section$end$__DATA$__llvm_pgo_names");
-extern uint64_t CountersStart __asm("section$start$__DATA$__llvm_pgo_cnts");
-extern uint64_t CountersEnd   __asm("section$end$__DATA$__llvm_pgo_cnts");
-
-const __llvm_pgo_data *__llvm_pgo_data_begin() { return &DataStart; }
-const __llvm_pgo_data *__llvm_pgo_data_end()   { return &DataEnd; }
-const char *__llvm_pgo_names_begin() { return &NamesStart; }
-const char *__llvm_pgo_names_end()   { return &NamesEnd; }
-const uint64_t *__llvm_pgo_counters_begin() { return &CountersStart; }
-const uint64_t *__llvm_pgo_counters_end()   { return &CountersEnd; }

Removed: compiler-rt/trunk/lib/profile/InstrProfilingDefault.c
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingDefault.c?rev=204372&view=auto
==============================================================================
--- compiler-rt/trunk/lib/profile/InstrProfilingDefault.c (original)
+++ compiler-rt/trunk/lib/profile/InstrProfilingDefault.c (removed)
@@ -1,59 +0,0 @@
-/*===- InstrProfilingDefault.c - Profile data default platfrom ------------===*\
-|*
-|*                     The LLVM Compiler Infrastructure
-|*
-|* This file is distributed under the University of Illinois Open Source
-|* License. See LICENSE.TXT for details.
-|*
-\*===----------------------------------------------------------------------===*/
-
-#include "InstrProfiling.h"
-
-static const __llvm_pgo_data *DataFirst = NULL;
-static const __llvm_pgo_data *DataLast = NULL;
-static const char *NamesFirst = NULL;
-static const char *NamesLast = NULL;
-static const uint64_t *CountersFirst = NULL;
-static const uint64_t *CountersLast = NULL;
-
-/*!
- * \brief Register an instrumented function.
- *
- * Calls to this are emitted by clang with -fprofile-instr-generate.  Such
- * calls are only required (and only emitted) on targets where we haven't
- * implemented linker magic to find the bounds of the sections.
- */
-void __llvm_pgo_register_function(void *Data_) {
-  /* TODO: Only emit this function if we can't use linker magic. */
-  const __llvm_pgo_data *Data = (__llvm_pgo_data*)Data_;
-  if (!DataFirst) {
-    DataFirst = Data;
-    DataLast = Data + 1;
-    NamesFirst = Data->Name;
-    NamesLast = Data->Name + Data->NameSize;
-    CountersFirst = Data->Counters;
-    CountersLast = Data->Counters + Data->NumCounters;
-    return;
-  }
-
-#define UPDATE_FIRST(First, New) \
-  First = New < First ? New : First
-  UPDATE_FIRST(DataFirst, Data);
-  UPDATE_FIRST(NamesFirst, Data->Name);
-  UPDATE_FIRST(CountersFirst, Data->Counters);
-#undef UPDATE_FIRST
-
-#define UPDATE_LAST(Last, New) \
-  Last = New > Last ? New : Last
-  UPDATE_LAST(DataLast, Data + 1);
-  UPDATE_LAST(NamesLast, Data->Name + Data->NameSize);
-  UPDATE_LAST(CountersLast, Data->Counters + Data->NumCounters);
-#undef UPDATE_LAST
-}
-
-const __llvm_pgo_data *__llvm_pgo_data_begin() { return DataFirst; }
-const __llvm_pgo_data *__llvm_pgo_data_end() { return DataLast; }
-const char *__llvm_pgo_names_begin() { return NamesFirst; }
-const char *__llvm_pgo_names_end() { return NamesLast; }
-const uint64_t *__llvm_pgo_counters_begin() { return CountersFirst; }
-const uint64_t *__llvm_pgo_counters_end() { return CountersLast; }

Copied: compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c (from r204347, compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c?p2=compiler-rt/trunk/lib/profile/InstrProfilingPlatformDarwin.c&p1=compiler-rt/trunk/lib/profile/InstrProfilingDarwin.c&r1=204347&r2=204373&rev=204373&view=diff
==============================================================================
    (empty)

Copied: compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c (from r204347, compiler-rt/trunk/lib/profile/InstrProfilingDefault.c)
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c?p2=compiler-rt/trunk/lib/profile/InstrProfilingPlatformOther.c&p1=compiler-rt/trunk/lib/profile/InstrProfilingDefault.c&r1=204347&r2=204373&rev=204373&view=diff
==============================================================================
    (empty)

Modified: compiler-rt/trunk/make/platform/clang_darwin.mk
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/make/platform/clang_darwin.mk?rev=204373&r1=204372&r2=204373&view=diff
==============================================================================
--- compiler-rt/trunk/make/platform/clang_darwin.mk (original)
+++ compiler-rt/trunk/make/platform/clang_darwin.mk Thu Mar 20 13:43:09 2014
@@ -223,7 +223,7 @@ FUNCTIONS.ios.x86_64h := $(FUNCTIONS.ios
 FUNCTIONS.osx	:= mulosi4 mulodi4 muloti4
 
 FUNCTIONS.profile_osx := GCDAProfiling InstrProfiling \
-                         InstrProfilingDarwin InstrProfilingExtras
+                         InstrProfilingPlatformDarwin InstrProfilingExtras
 FUNCTIONS.profile_ios := $(FUNCTIONS.profile_osx)
 
 FUNCTIONS.asan_osx_dynamic := $(AsanFunctions) $(InterceptionFunctions) \





More information about the llvm-commits mailing list