Index: build/toolchain/toolchain.gni |
diff --git a/build/toolchain/toolchain.gni b/build/toolchain/toolchain.gni |
index f0e455282c1959d85da4564101719433f52cbad5..f389eec29e41bf0d97c8a8ade6b867d497fe386b 100644 |
--- a/build/toolchain/toolchain.gni |
+++ b/build/toolchain/toolchain.gni |
@@ -22,10 +22,13 @@ declare_args() { |
# build/config/compiler/BUILD.gn). |
use_lld = is_win && host_os != "win" |
- if (is_clang) { |
- # Clang compiler version. Clang files are placed at version-dependent paths. |
- clang_version = "3.9.0" |
- } |
+ # 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 |
# Compile with Xcode version of clang instead of hermetic version shipped |
# with the build. Used on iOS to ship official builds (as they are built |
@@ -33,6 +36,17 @@ declare_args() { |
use_xcode_clang = is_ios && is_official_build |
} |
+if (is_clang) { |
+ # Clang compiler version. Clang files are placed at version-dependent paths. |
+ clang_version = "3.9.0" |
+ |
+ if (llvm_force_head_revision) { |
+ # TODO(hans): Remove after next Clang roll. |
+ # ToT Clang has a higher version number. |
+ clang_version = "4.0.0" |
+ } |
+} |
+ |
assert(!use_xcode_clang || is_ios, |
"Using Xcode's clang is only supported in iOS builds") |