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

@@ -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;