Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(278)

Side by Side Diff: tools/clang/empty_string/EmptyStringConverter.cpp

Issue 723343002: Update from https://crrev.com/304121 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « third_party/zlib/zlib.gyp ('k') | tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // This implements a Clang tool to convert all instances of std::string("") to 5 // This implements a Clang tool to convert all instances of std::string("") to
6 // std::string(). The latter is more efficient (as std::string doesn't have to 6 // std::string(). The latter is more efficient (as std::string doesn't have to
7 // take a copy of an empty string) and generates fewer instructions as well. It 7 // take a copy of an empty string) and generates fewer instructions as well. It
8 // should be run using the tools/clang/scripts/run_tool.py helper. 8 // should be run using the tools/clang/scripts/run_tool.py helper.
9 9
10 #include <memory> 10 #include <memory>
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 189
190 // Each replacement line should have the following format: 190 // Each replacement line should have the following format:
191 // r:<file path>:<offset>:<length>:<replacement text> 191 // r:<file path>:<offset>:<length>:<replacement text>
192 // Only the <replacement text> field can contain embedded ":" characters. 192 // Only the <replacement text> field can contain embedded ":" characters.
193 // TODO(dcheng): Use a more clever serialization. Ideally we'd use the YAML 193 // TODO(dcheng): Use a more clever serialization. Ideally we'd use the YAML
194 // serialization and then use clang-apply-replacements, but that would require 194 // serialization and then use clang-apply-replacements, but that would require
195 // copying and pasting a larger amount of boilerplate for all Chrome clang 195 // copying and pasting a larger amount of boilerplate for all Chrome clang
196 // tools. 196 // tools.
197 llvm::outs() << "==== BEGIN EDITS ====\n"; 197 llvm::outs() << "==== BEGIN EDITS ====\n";
198 for (const auto& r : replacements) { 198 for (const auto& r : replacements) {
199 llvm::outs() << "r:" << r.getFilePath() << ":" << r.getOffset() << ":" 199 llvm::outs() << "r:::" << r.getFilePath() << ":::" << r.getOffset() << ":::"
200 << r.getLength() << ":" << r.getReplacementText() << "\n"; 200 << r.getLength() << ":::" << r.getReplacementText() << "\n";
201 } 201 }
202 llvm::outs() << "==== END EDITS ====\n"; 202 llvm::outs() << "==== END EDITS ====\n";
203 203
204 return 0; 204 return 0;
205 } 205 }
OLDNEW
« no previous file with comments | « third_party/zlib/zlib.gyp ('k') | tools/clang/rewrite_scoped_refptr/RewriteScopedRefptr.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698