[PATCH] D71527: [Driver] Avoid copies in range-based for loops
Mark de Wever via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Dec 17 12:58:44 PST 2019
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb750486c5d96: [Driver] Avoid copies in range-based for loops (authored by Mordante).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D71527/new/
https://reviews.llvm.org/D71527
Files:
clang/lib/Driver/Driver.cpp
clang/lib/Driver/ToolChain.cpp
Index: clang/lib/Driver/ToolChain.cpp
===================================================================
--- clang/lib/Driver/ToolChain.cpp
+++ clang/lib/Driver/ToolChain.cpp
@@ -850,7 +850,7 @@
/*static*/ void ToolChain::addSystemIncludes(const ArgList &DriverArgs,
ArgStringList &CC1Args,
ArrayRef<StringRef> Paths) {
- for (const auto Path : Paths) {
+ for (const auto &Path : Paths) {
CC1Args.push_back("-internal-isystem");
CC1Args.push_back(DriverArgs.MakeArgString(Path));
}
Index: clang/lib/Driver/Driver.cpp
===================================================================
--- clang/lib/Driver/Driver.cpp
+++ clang/lib/Driver/Driver.cpp
@@ -744,7 +744,7 @@
ArrayRef<std::string> Dirs,
StringRef FileName) {
SmallString<128> WPath;
- for (const StringRef &Dir : Dirs) {
+ for (const std::string &Dir : Dirs) {
if (Dir.empty())
continue;
WPath.clear();
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D71527.234370.patch
Type: text/x-patch
Size: 1048 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191217/c8e3d3b6/attachment.bin>
More information about the cfe-commits
mailing list