Skip to content

Commit

Permalink
[Driver] Avoid copies in range-based for loops
Browse files Browse the repository at this point in the history
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.

Differential Revision: https://reviews.llvm.org/D71527
  • Loading branch information
mordante committed Dec 17, 2019
1 parent 3ec6128 commit b750486
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion clang/lib/Driver/Driver.cpp
Expand Up @@ -744,7 +744,7 @@ static bool searchForFile(SmallVectorImpl<char> &FilePath,
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();
Expand Down
2 changes: 1 addition & 1 deletion clang/lib/Driver/ToolChain.cpp
Expand Up @@ -850,7 +850,7 @@ void ToolChain::addExternCSystemIncludeIfExists(const ArgList &DriverArgs,
/*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));
}
Expand Down

0 comments on commit b750486

Please sign in to comment.