0

clang tools: Add --bootstrap to the documentation for update.py

This lets us build the clang tools with clang not gcc, which appears to
have bugs!

Also work around the gcc bug in one place we know it happens anyways,
just because.

R=dcheng
BUG=580745

Review URL: https://codereview.chromium.org/1647733002

Cr-Commit-Position: refs/heads/master@{#371933}
This commit is contained in:
danakj
2016-01-27 16:26:33 -08:00
committed by Commit bot
parent 727bd37e17
commit 30d0f8c92a
2 changed files with 8 additions and 2 deletions
docs
tools/clang/rewrite_to_chrome_style

@ -97,7 +97,7 @@ doesn't work well for Chromium:
Synopsis:
```shell
tools/clang/scripts/update.py --force-local-build --without-android \
tools/clang/scripts/update.py --bootstrap --force-local-build --without-android \
--tools blink_gc_plugin plugins rewrite_to_chrome_style
```
@ -109,6 +109,9 @@ subdirectories in
[//tools/clang](https://chromium.googlesource.com/chromium/src/+/master/tools/clang).
Generally, `--tools` should always include `blink_gc_plugin` and `plugins`: otherwise, Chromium won't build.
It is important to use --bootstrap as there appear to be [bugs](https://crbug.com/580745)
in the clang library this script produces if you build it with gcc, which is the default.
## Running
First, build all chromium targets to avoid failures due to missing dependecies
that are generated as part of the build:

@ -111,7 +111,10 @@ bool GetNameForDecl(const clang::FieldDecl& decl,
original_name.substr(strlen(kBlinkFieldPrefix)));
// The few examples I could find used struct-style naming with no `_` suffix
// for unions.
if (decl.getParent()->isClass())
bool c = decl.getParent()->isClass();
// There appears to be a GCC bug that makes this branch incorrectly if we
// don't use a temp variable!! Clang works right. crbug.com/580745
if (c)
name += '_';
return true;
}