Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 07408d69c64d67f4159ae5b371295b97150f43a4..aa7b2a0969ffdb01e3f953e309e91ed506dd8a38 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -90,6 +90,27 @@ declare_args() { |
# Gold icf level, values are "none", "safe", "all". If value isn't overridden, |
# default initialization is below. |
gold_icf_level = "" |
+ |
+ # If this is set to true, or if LLVM_FORCE_HEAD_REVISION is set to 1 |
+ # in the environment, we use the revision in the llvm repo to determine |
+ # the CLANG_REVISION to use, instead of the version hard-coded into |
+ # //tools/clang/scripts/update.py. This should only be used in |
+ # conjunction with setting LLVM_FORCE_HEAD_REVISION in the |
+ # environment when `gclient runhooks` is run as well. |
+ llvm_force_head_revision = false |
+} |
+ |
+if (is_clang && !is_nacl) { |
+ # This is here so that all files get recompiled after a clang roll and |
+ # when turning clang on or off. (defines are passed via the command line, |
+ # and build system rebuild things when their commandline changes). Nothing |
+ # should ever read this define. |
+ update_args = [ "--print-revision" ] |
+ if (llvm_force_head_revision) { |
+ update_args += [ "--llvm-force-head-revision" ] |
+ } |
+ clang_revision = |
+ exec_script("//tools/clang/scripts/update.py", update_args, "trim string") |
} |
# Apply the default logic for these values if they were not set explicitly. |
@@ -222,14 +243,7 @@ config("compiler") { |
} |
if (is_clang && !is_nacl) { |
- # This is here so that all files get recompiled after a clang roll and |
- # when turning clang on or off. (defines are passed via the command line, |
- # and build system rebuild things when their commandline changes). Nothing |
- # should ever read this define. |
- defines += |
- [ "CR_CLANG_REVISION=" + exec_script("//tools/clang/scripts/update.py", |
- [ "--print-revision" ], |
- "trim string") ] |
+ defines += [ "CR_CLANG_REVISION=$clang_revision" ] |
Nico
2016/04/24 01:52:48
restore this to what it was (except with the added
Dirk Pranke
2016/04/24 20:49:18
I'm not sure I understand what you're asking here,
|
} |
# Non-Mac Posix compiler flags setup. |
@@ -974,9 +988,7 @@ config("default_warnings") { |
"-Wno-shift-negative-value", |
] |
- if (exec_script("//tools/clang/scripts/update.py", |
- [ "--print-revision" ], |
- "trim string") != "266460-1") { |
+ if (clang_revision != "266460-1") { |
Nico
2016/04/24 01:52:48
make this say
if (llvm_force_head_revision)
si
Dirk Pranke
2016/04/24 20:49:18
Okay, it wasn't clear to me if the intent was "ToT
|
cflags += [ |
# TODO(thakis): https://crbug.com/604888 |
"-Wno-undefined-var-template", |