forked from OSchip/llvm-project
Use range-based loops when handling OPT_print_search_dirs.
llvm-svn: 240476
This commit is contained in:
parent
51af160f4c
commit
51fe7bf227
|
@ -740,25 +740,25 @@ bool Driver::HandleImmediateArgs(const Compilation &C) {
|
||||||
|
|
||||||
if (C.getArgs().hasArg(options::OPT_print_search_dirs)) {
|
if (C.getArgs().hasArg(options::OPT_print_search_dirs)) {
|
||||||
llvm::outs() << "programs: =";
|
llvm::outs() << "programs: =";
|
||||||
for (ToolChain::path_list::const_iterator it = TC.getProgramPaths().begin(),
|
bool separator = false;
|
||||||
ie = TC.getProgramPaths().end(); it != ie; ++it) {
|
for (const std::string &Path : TC.getProgramPaths()) {
|
||||||
if (it != TC.getProgramPaths().begin())
|
if (separator) llvm::outs() << ':';
|
||||||
llvm::outs() << ':';
|
llvm::outs() << Path;
|
||||||
llvm::outs() << *it;
|
separator = true;
|
||||||
}
|
}
|
||||||
llvm::outs() << "\n";
|
llvm::outs() << "\n";
|
||||||
llvm::outs() << "libraries: =" << ResourceDir;
|
llvm::outs() << "libraries: =" << ResourceDir;
|
||||||
|
|
||||||
StringRef sysroot = C.getSysRoot();
|
StringRef sysroot = C.getSysRoot();
|
||||||
|
|
||||||
for (ToolChain::path_list::const_iterator it = TC.getFilePaths().begin(),
|
for (const std::string &Path : TC.getFilePaths()) {
|
||||||
ie = TC.getFilePaths().end(); it != ie; ++it) {
|
// Always print a separator. ResourceDir was the first item shown.
|
||||||
llvm::outs() << ':';
|
llvm::outs() << ':';
|
||||||
const char *path = it->c_str();
|
// Interpretation of leading '=' is needed only for NetBSD.
|
||||||
if (path[0] == '=')
|
if (Path[0] == '=')
|
||||||
llvm::outs() << sysroot << path + 1;
|
llvm::outs() << sysroot << (Path.c_str() + 1);
|
||||||
else
|
else
|
||||||
llvm::outs() << path;
|
llvm::outs() << Path;
|
||||||
}
|
}
|
||||||
llvm::outs() << "\n";
|
llvm::outs() << "\n";
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue