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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user