mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 21:31:04 +00:00
Bug 1444171: Generate profiling instrumentation for clang-cl in PGO builds; r=glandium
This commit is contained in:
parent
e8a82fdba9
commit
9277d23dba
@ -157,7 +157,7 @@ endif
|
||||
# Enable profile-based feedback
|
||||
ifneq (1,$(NO_PROFILE_GUIDED_OPTIMIZE))
|
||||
ifdef MOZ_PROFILE_GENERATE
|
||||
PGO_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS))
|
||||
PGO_CFLAGS += $(if $(filter $(notdir $<),$(notdir $(NO_PROFILE_GUIDED_OPTIMIZE))),,$(PROFILE_GEN_CFLAGS) $(COMPUTED_PROFILE_GEN_DYN_CFLAGS))
|
||||
PGO_LDFLAGS += $(PROFILE_GEN_LDFLAGS)
|
||||
ifeq (WINNT,$(OS_ARCH))
|
||||
AR_FLAGS += -LTCG
|
||||
|
@ -451,6 +451,7 @@ class CompileFlags(BaseCompileFlags):
|
||||
('DSO_PIC', context.config.substs.get('DSO_PIC_CFLAGS'),
|
||||
('CXXFLAGS', 'CFLAGS')),
|
||||
('RTL', None, ('CXXFLAGS', 'CFLAGS')),
|
||||
('PROFILE_GEN_DYN_CFLAGS', None, ('PROFILE_GEN_DYN_CFLAGS',)),
|
||||
('OS_COMPILE_CFLAGS', context.config.substs.get('OS_COMPILE_CFLAGS'),
|
||||
('CFLAGS',)),
|
||||
('OS_COMPILE_CXXFLAGS', context.config.substs.get('OS_COMPILE_CXXFLAGS'),
|
||||
|
@ -1074,6 +1074,18 @@ class TreeMetadataEmitter(LoggingMixin):
|
||||
not context.config.substs.get('MOZ_NO_DEBUG_RTL')):
|
||||
rtl_flag += 'd'
|
||||
computed_flags.resolve_flags('RTL', [rtl_flag])
|
||||
# For PGO clang-cl builds, we generate order files in the
|
||||
# profile generate phase that are subsequently used to link the
|
||||
# final library. We need to provide flags to the compiler to
|
||||
# have it instrument functions for generating the data for the
|
||||
# order file. We'd normally put flags like these in
|
||||
# PROFILE_GEN_CFLAGS or the like, but we need to only use the
|
||||
# flags in contexts where we're compiling code for xul.
|
||||
code_for_xul = context.get('FINAL_LIBRARY', 'notxul') == 'xul'
|
||||
if context.config.substs.get('CLANG_CL') and code_for_xul:
|
||||
computed_flags.resolve_flags('PROFILE_GEN_DYN_CFLAGS',
|
||||
['-Xclang',
|
||||
'-finstrument-functions-after-inlining'])
|
||||
if not context.config.substs.get('CROSS_COMPILE'):
|
||||
computed_host_flags.resolve_flags('RTL', [rtl_flag])
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user