From ad53c076409f8b6d37de8514b0bcd80432ee342b Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Thu, 20 Mar 2014 19:23:53 +0000 Subject: 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204380 91177308-0d34-0410-b5e6-96231b3b80d8 --- make/platform/clang_darwin.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'make') 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) \ -- cgit v1.2.3