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:
@@ -69,7 +69,7 @@ static const llvm::opt::ArgStringList *getCC1Arguments(
|
||||
// We expect to get back exactly one Command job, if we didn't something
|
||||
// failed. Extract that job from the Compilation.
|
||||
const clang::driver::JobList &Jobs = Compilation->getJobs();
|
||||
if (Jobs.size() != 1 || !isa<clang::driver::Command>(**Jobs.begin())) {
|
||||
if (Jobs.size() != 1 || !isa<clang::driver::Command>(*Jobs.begin())) {
|
||||
SmallString<256> error_msg;
|
||||
llvm::raw_svector_ostream error_stream(error_msg);
|
||||
Jobs.Print(error_stream, "; ", true);
|
||||
@@ -80,7 +80,7 @@ static const llvm::opt::ArgStringList *getCC1Arguments(
|
||||
|
||||
// The one job we find should be to invoke clang again.
|
||||
const clang::driver::Command &Cmd =
|
||||
cast<clang::driver::Command>(**Jobs.begin());
|
||||
cast<clang::driver::Command>(*Jobs.begin());
|
||||
if (StringRef(Cmd.getCreator().getName()) != "clang") {
|
||||
Diagnostics->Report(clang::diag::err_fe_expected_clang_command);
|
||||
return nullptr;
|
||||
|
||||
Reference in New Issue
Block a user