Driver: Use pointee_iterator rather than iterating over unique_ptrs

There's probably never a good reason to iterate over unique_ptrs. This
lets us use range-for and say Job.foo instead of (*it)->foo in a few
places.

llvm-svn: 218938
This commit is contained in:
Justin Bogner
2014-10-03 01:04:53 +00:00
parent e83f59e658
commit aab9792b6c
7 changed files with 16 additions and 17 deletions

View File

@@ -63,7 +63,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
// We expect to get back exactly one command job, if we didn't something
// failed.
const driver::JobList &Jobs = C->getJobs();
if (Jobs.size() != 1 || !isa<driver::Command>(**Jobs.begin())) {
if (Jobs.size() != 1 || !isa<driver::Command>(*Jobs.begin())) {
SmallString<256> Msg;
llvm::raw_svector_ostream OS(Msg);
Jobs.Print(OS, "; ", true);
@@ -71,7 +71,7 @@ clang::createInvocationFromCommandLine(ArrayRef<const char *> ArgList,
return nullptr;
}
const driver::Command &Cmd = cast<driver::Command>(**Jobs.begin());
const driver::Command &Cmd = cast<driver::Command>(*Jobs.begin());
if (StringRef(Cmd.getCreator().getName()) != "clang") {
Diags->Report(diag::err_fe_expected_clang_command);
return nullptr;