[clang] Add StringPiece Rewriter Tool
This change adds a clang tool to rewrite deprecated base::StringPiece APIs. To do so, it makes use Clang Transformer [1], significantly reducing the required boilerplate. For now, it only removes usages of the `as_string()` API, replacing it with explicit std::string constructions or omitting it entirely, if possible. The edits generated by the tool compile cleanly, except when used in complicated macro expressions. In these cases commas might not be enclosed in parentheses correctly. While it'd be possible to modify the tool to handle these cases properly, the required effort likely outweighs a small manual pass over the result to fix these issues. [1] http://lists.llvm.org/pipermail/cfe-dev/2018-November/060184.html Bug: 1049498 Change-Id: I77a0945d6cb59bde6f2ad65f079a399f67bbd054 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601742 Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org> Reviewed-by:Daniel Cheng <dcheng@chromium.org> Reviewed-by:
Łukasz Anforowicz <lukasza@chromium.org> Cr-Commit-Position: refs/heads/master@{#841008}
Showing
Please register or sign in to comment