diff options
author | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-20 19:23:53 +0000 |
---|---|---|
committer | Duncan P. N. Exon Smith <dexonsmith@apple.com> | 2014-03-20 19:23:53 +0000 |
commit | ad53c076409f8b6d37de8514b0bcd80432ee342b (patch) | |
tree | 820c1e4354e2745269536b3e1d2d4031042442f6 /make | |
parent | 4bf72cf3f5f753ff76d06aa38fef14b9aefb083f (diff) |
PGO: Add explicit static initialization
Instead of relying on explicit static initialization from translation
units, create a new file, InstrProfilingRuntime.cc, with an
__llvm_pgo_runtime variable. After this commit (and its pair in clang),
the driver will create a use of this variable. Unless the user defines
their own version, the new object file will get pulled in, including
that C++ static initialization that calls
__llvm_pgo_register_write_atexit.
The result is that, at least on Darwin, static initialization typically
consists of a single function call, which registers a writeout functino
atexit. Furthermore, users can skip even this behaviour by defining
their own __llvm_pgo_runtime.
<rdar://problem/15943240>
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204380 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'make')
-rw-r--r-- | make/platform/clang_darwin.mk | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/make/platform/clang_darwin.mk b/make/platform/clang_darwin.mk index 0feb55341..2fdf051bc 100644 --- a/make/platform/clang_darwin.mk +++ b/make/platform/clang_darwin.mk @@ -223,7 +223,8 @@ FUNCTIONS.ios.x86_64h := $(FUNCTIONS.ios.x86_64) FUNCTIONS.osx := mulosi4 mulodi4 muloti4 FUNCTIONS.profile_osx := GCDAProfiling InstrProfiling \ - InstrProfilingPlatformDarwin InstrProfilingExtras + InstrProfilingPlatformDarwin InstrProfilingRuntime \ + InstrProfilingExtras FUNCTIONS.profile_ios := $(FUNCTIONS.profile_osx) FUNCTIONS.asan_osx_dynamic := $(AsanFunctions) $(InterceptionFunctions) \ |