Files
clang-p2996/compiler-rt/lib/profile/Makefile.mk
Duncan P. N. Exon Smith 775c178a90 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>

llvm-svn: 204380
2014-03-20 19:23:53 +00:00

19 lines
617 B
Makefile

#===- lib/profile/Makefile.mk ------------------------------*- Makefile -*--===#
#
# The LLVM Compiler Infrastructure
#
# This file is distributed under the University of Illinois Open Source
# License. See LICENSE.TXT for details.
#
#===------------------------------------------------------------------------===#
ModuleName := profile
SubDirs :=
Sources := $(foreach file,$(wildcard $(Dir)/*.c $(Dir)/*.cc),$(notdir $(file)))
ObjNames := $(patsubst %.c,%.o,$(patsubst %.cc,%.o,$(Sources)))
Implementation := Generic
# FIXME: use automatic dependencies?
Dependencies := $(wildcard $(Dir)/*.h)