0
Commit Graph

26 Commits

Author SHA1 Message Date
d93068c1be Add cross-compiling info to Clang Tool Refactoring doc
We mention the need to pass a --target_os to the run_tool.py script
when cross-compiling.

Bug: None
Change-Id: Idf4ea9ffd0bdf9e1a4c4cbc57ae8986fd8bf50c8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3298271
Auto-Submit: Kevin McNee <mcnee@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#945202}
2021-11-25 00:59:34 +00:00
046f987e02 [COIL] Change chromium code search type links to use main rather than master for docs
See this doc: go/chromium-coil-change for more info
    BUG=1210385

Change-Id: I6cd8548301e360bae8e71384dbd8ef11aa6c985f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2902904
Reviewed-by: My Nguyen <myy@chromium.org>
Commit-Queue: My Nguyen <myy@chromium.org>
Auto-Submit: John Palmer <jopalmer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#885851}
2021-05-24 01:24:56 +00:00
e4d0e92f4a Inserting an include of the new header during the rewrite.
Bug: 1069567
Change-Id: I85fa41b304db2f4902b0c2f46290f49279316f3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2151338
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Bartek Nowierski <bartekn@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#766144}
2020-05-06 20:47:12 +00:00
6e1ce9f494 Force jumbo builds to fail.
We no longer have any builders supporting the jumbo build config,
and it's time to now update all of the build files to remove
the jumbo templates. Before we do that, though, it's probably good
to figure out how to handle existing uses of the jumbo builds.

This CL asserts that |use_jumbo_build| is set to false. Once
we've run with this for a while (to ensure that people have
adjusted their configs), we can probably update any CI build
configs to remove the use of it and the other jumbo-related GN
args and then remove the actual declare_args() of the three
jumbo args, turning uses of them into warnings.

Bug: 994387
Change-Id: Ibe395e51c837692ff9a7b6d01141c32ddab5459b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1874583
Commit-Queue: Dirk Pranke <dpranke@chromium.org>
Reviewed-by: Bruce Dawson <brucedawson@chromium.org>
Reviewed-by: Aaron Gable <agable@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#710481}
2019-10-29 22:53:53 +00:00
d1eec55fb8 clang update.py: move the code for building into build.py
Over time update.py has become a really complicated file. This is a step
towards simplifying things by making update.py be a script focused on updating
and build.py on building.

Bug: 884608
Change-Id: I4d65a2416f39e832b685495bd53cbe284f97967a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1571628
Commit-Queue: Hans Wennborg <hans@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#656007}
2019-05-02 14:59:07 +00:00
748bb0dd58 Add remove_unneeded_adapt_callback tool to base_bind_rewriters
This CL adds a rewriter to //tools/clang/base_bind_rewriters
which removes calls to base::AdaptCallbackForRepeating when the
returned base::RepeatingCallback is immediately converted
to a base::OnceCallback.​

Change-Id: I14ca9af2b3abc095b978c2cd7cf1fea1844ef428
Reviewed-on: https://chromium-review.googlesource.com/817740
Commit-Queue: Yannic Bonenberger <contact@yannic-bonenberger.com>
Reviewed-by: Taiju Tsuiki <tzik@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#571999}
2018-07-02 21:10:06 +00:00
69413bece3 Update clang tool documentation.
- Add an easier-to-use command for AST dumping.
- Update caveats to note that it doesn't work for jumbo builds.
- Remove caveat to use git, since it's more-or-less assumed.
- Use reference style links to make the actual text easier to edit.

Change-Id: I25bd7461ccc9fc4910fe0ef18b01e32a37023530
Reviewed-on: https://chromium-review.googlesource.com/734480
Reviewed-by: Nico Weber <thakis@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#510989}
2017-10-24 01:23:57 +00:00
8c5b825c07 Update and Clean Up value_cleanup Tool
This change adds a value rewriter to the value_cleanup clang tool. It is
intended to be extended for future use cases, currently it supports the
renaming of base::Value::GetType to base::Value::type.

Furthermore, this change removes the existing ListValueRewriters which
became obsolete with r464866. For future discoverability it adds a
reference to //docs/clang_tool_refactoring.md.

Bug: 646113, 581865
Change-Id: I07b5c1279753a65c123ebdd4a5c5f3a384321081
Reviewed-on: https://chromium-review.googlesource.com/702454
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#508932}
2017-10-14 06:28:58 +00:00
eb3f807adc Tests added to traffic annotation extractor clang tool.
Test suit is added to network traffic annotation extractor clang tool.

Bug: 656607
Bug: 690323
Change-Id: Ie7adc46694eba1bf1dc05bd08ccacf4c8e42743b
Reviewed-on: https://chromium-review.googlesource.com/590236
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Reviewed-by: Martin Šrámek <msramek@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491276}
2017-08-02 05:31:31 +00:00
9ed3f43a6c Add a clang tool to detect std::move(raw ptr)
The CL also adds a sentence to the documentation for clang tools, to supply a
bit which was unclear for me during writing of the added tool.

So far, on Linux, the tool found instances of std::move(raw ptr) in:

../../components/browser_sync/profile_sync_service.cc:10101
../../components/sync_sessions/sessions_sync_manager.cc:5987
../../content/browser/indexed_db/indexed_db_transaction.cc:3865
../../gpu/ipc/service/gpu_channel.cc:26467
../../services/preferences/tracked/pref_hash_store_impl.cc:3329
../../services/preferences/tracked/pref_hash_store_impl.cc:4518
../../services/ui/public/cpp/bitmap/child_shared_bitmap_manager.cc:5009
../../services/video_capture/test/mock_device_factory.cc:2266

It also found it in some 3rd party headers, such as
../../third_party/flatbuffers/src/include/flatbuffers/flatbuffers.h:8260
../../third_party/skia/include/core/SkCanvas.h:14756
../../third_party/webrtc/api/proxy.h:16937
../../third_party/webrtc/api/proxy.h:19681
../../third_party/webrtc/api/proxy.h:20241
and c++ libs.

The Chromium 1st party instances will be addressed in separate CLs. For the headers, I'll consider if it makes sense to address this (e.g., some occurrences seem to be template instantiations, where the template is not a priori aware that the supplied type is a raw pointer; in such cases std::move should stay).

I may also run the tool on more platforms.

Finally, while preventing regressions would be good, it seems impractical to run this tool as a presubmit check. However, I will try to run it after https://crbug.com/646113 is finished, because that base::Value refactoring might introduce some instances (happened to me recently).

BUG=729393,731577

Review-Url: https://codereview.chromium.org/2919243002
Cr-Commit-Position: refs/heads/master@{#478226}
2017-06-09 07:30:42 +00:00
82f80d6162 Fix a typo in Clang tool refactoring docs
runtime => run time

Change-Id: I9fcc4b0c8b6156676985428b9eec7a6f3cb3fd34
Reviewed-on: https://chromium-review.googlesource.com/508120
Commit-Queue: danakj <danakj@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#472803}
2017-05-18 14:48:27 +00:00
51c5530a57 clang tooling: Make script arguments more consistent and update docs
- all: Use -p consistently to specify a path to the compile db to match
  the convention of clang::tooling::ClangTool
- all: Default -p to out/Debug for convenience.
- docs: Update docs to reference renamed arguments
- docs: Update clang-tidy documentation to use the compile DB generation
  wrapper script
- run_tool.py: Change tool to a non-positional argument and make it a
  required argument.

Change-Id: I378402cab36e86da4b13fb43e26067cad4db1795
Reviewed-on: https://chromium-review.googlesource.com/494946
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#469409}
2017-05-04 19:03:22 +00:00
886eadcb2e Share logic for generating compile DB with run_tool.py
BUG=676588
R=thakis@chromium.org

Review-Url: https://codereview.chromium.org/2798233002 .
Cr-Commit-Position: refs/heads/master@{#462582}
2017-04-06 19:26:23 +00:00
f239071ad5 clang update script: add --extra-tools, deprecate --tools flag
plugins and blink_gc_plugin are always mandatory for Chromium builds,
so just always include them. In order to avoid breaking codesearch
bots, --tools is now a synonym for --extra-tools and will be removed.

BUG=none

Review-Url: https://codereview.chromium.org/2609683002
Cr-Commit-Position: refs/heads/master@{#441601}
2017-01-05 06:46:28 +00:00
f9b89e7bd4 Split run_tool.py into run_tool.py, extract_edits.py and apply_edits.py
The split will allow generation of edits on multiple configs (e.g. linux
vs windows OR rel vs dbg) and merging the edits before applying them once:
    $ tools/clang/scripts/run_tool.py rewrite_to_chrome_style \
        --generate-compdb --all out/rel >run_tool.linux.rel.out
    $ ...
    $ cat run_tool.*.out \
        | tools/clang/scripts/extract_edits.py \
        | tools/clang/scripts/apply_edits.py
        --generate-compdb --all out/rel >run_tool.linux.rel.out

Test steps:
- tools/clang/translation_unit/test_translation_unit.py
- tools/clang/scripts/test_tool.py rewrite_to_chrome_style
- manually running run_tool | extract_edits | apply_edits pipeline
  on WTF and verifying that it still builds after the rename

BUG=598138
TEST=See "Test steps" above.

Review-Url: https://codereview.chromium.org/2599193002
Cr-Commit-Position: refs/heads/master@{#440881}
2016-12-28 19:45:27 +00:00
ca6b31b571 Update Windows-specific docs for the clang rewriting tool.
R=dcheng@chromium.org

Review-Url: https://codereview.chromium.org/2596383002
Cr-Commit-Position: refs/heads/master@{#440516}
2016-12-22 22:09:42 +00:00
c0dc6f499d Fix spelling mistakes in //docs.
This includes spelling mistakes like:

accomodate->accommodate
ommited->omitted
unuseable->unusable
dependant->dependent
enviroment->environment
preceed->precede
occurrance->occurrence
occurrances->occurrences
intergrated->integrated
altough->although
appriopriate->appropriate
corresponing->corresponding
dependecies->dependencies
leniant->lenient
overriden->overridden
persisten->persistent
specifyinhg->specifying

As well as capitalization changes like:

javascript->JavaScript
Webkit->WebKit
linux->Linux

A couple other minor things:

the the -> the
trybot -> try bot
etc.

Review-Url: https://codereview.chromium.org/2551513002
Cr-Commit-Position: refs/heads/master@{#436046}
2016-12-02 22:16:53 +00:00
1333f1b925 Skip ParmVarDecl nodes without a name.
BUG=598141

Review-Url: https://codereview.chromium.org/2246263002
Cr-Commit-Position: refs/heads/master@{#414877}
2016-08-27 00:27:15 +00:00
30d0f8c92a 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}
2016-01-28 00:27:53 +00:00
9ce2a30f5e Fix clang tool refactoring docs formatting.
Argh... whitespace!

BUG=none
R=danakj@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#369903}
2016-01-16 01:19:45 +00:00
ef9f1facc0 docs: Fix links/shell with whitespace changes.
Links shouldn't have whitespace inside them, shell snippets
need whitespace around them.

R=dcheng

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

Cr-Commit-Position: refs/heads/master@{#369894}
2016-01-16 00:38:18 +00:00
ce2375ee82 Update documentation for clang tool refactoring.
BUG=none

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

Cr-Commit-Position: refs/heads/master@{#368748}
2016-01-12 01:10:16 +00:00
a219155337 Update tool docs to use --tools flag
BUG=494442
R=dcheng@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#362775}
2015-12-02 19:44:22 +00:00
e250e6adb0 Remove stray references to update.sh from src/
BUG=494442
R=hans@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#362772}
2015-12-02 19:34:13 +00:00
6eaa0c0d01 Markdown style fixes for:
code_coverage.md
cocoa_tips_and_tricks.md
closure_compilation.md
clang_format.md
clang_tool_refactoring.md
clang.md

R=nodir
BUG=524256

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

Cr-Commit-Position: refs/heads/master@{#345652}
2015-08-26 20:13:51 +00:00
3322f7611b Per https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/irLAQ8f8uGk
Initial migration of wiki content over to src/docs

There will be a follow-up CL to ensure docs are following chromium’s style guide, links are fixed, etc. The file auditing was becoming too much for a single change and per Nico’s suggestion, it seems to be better to do

+ Bulk import with initial prune.
+ Follow-up CLs to clean up the documentation.

So that each CL has its own purpose.

BUG=none

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

Cr-Commit-Position: refs/heads/master@{#345186}
2015-08-24 21:39:36 +00:00