Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(25)

Side by Side Diff: build/config/pgo/BUILD.gn

Issue 2507333002: Add the possibility to build with PGO when using Clang (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import("//build/config/clang/clang.gni")
6 import("//build/config/compiler/compiler.gni")
7 import("//build/config/pgo/pgo.gni")
8
9 # Applies linker flags necessary when profile-guided optimization is used.
10 # Flags are only added if PGO is enabled, so that this config is safe to
11 # include by default.
12 config("default_pgo_ldflags") {
13 visibility = [ ":default_pgo_flags" ]
14 ldflags = []
15
16 if (is_clang && !is_nacl) {
17 if (chrome_pgo_phase == 1) {
18 ldflags += [ "-fprofile-instr-generate" ]
19 }
20 }
21 }
22
23 # Applies compiler flags necessary when profile-guided optimization is used.
24 # Flags are only added if PGO is enabled, so that this config is safe to
Sébastien Marchand 2016/11/17 17:31:15 I'm not sure that this is safe to assume that this
25 # include by default.
26 config("pgo_flags") {
27 visibility = [ ":default_pgo_flags" ]
28 cflags = []
29
30 if (is_clang && !is_nacl) {
Sébastien Marchand 2016/11/17 17:31:15 Could you add some TODO (assigned to me) to move t
31 if (chrome_pgo_phase == 1) {
32 cflags += [ "-fprofile-instr-generate" ]
33 } else if (chrome_pgo_phase == 2) {
34 assert(pgo_data_path != "",
35 "Please set pgo_data_path to point at the profile data")
36 cflags += [
37 "-fprofile-instr-use=$pgo_data_path",
38
39 # It's possible to have some profile data legitimately missing, and at l east some
40 # profile data always ends up being considered out of date, so make sure we don't
41 # error for those cases.
42 "-Wno-profile-instr-unprofiled",
43 "-Wno-error=profile-instr-out-of-date",
44 ]
45 }
46 }
47 }
48
49 config("default_pgo_flags") {
50 configs = [
51 ":default_pgo_ldflags",
52 ":pgo_flags",
53 ]
54 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698