From aab9792b6c46b07f4f2caee1778f619387781e0c Mon Sep 17 00:00:00 2001 From: Justin Bogner Date: Fri, 3 Oct 2014 01:04:53 +0000 Subject: 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 --- clang/lib/Tooling/CompilationDatabase.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'clang/lib/Tooling/CompilationDatabase.cpp') diff --git a/clang/lib/Tooling/CompilationDatabase.cpp b/clang/lib/Tooling/CompilationDatabase.cpp index f16f64744e2..7613988c96d 100644 --- a/clang/lib/Tooling/CompilationDatabase.cpp +++ b/clang/lib/Tooling/CompilationDatabase.cpp @@ -249,10 +249,9 @@ static bool stripPositionalArgs(std::vector Args, CompileJobAnalyzer CompileAnalyzer; - for (driver::JobList::const_iterator I = Jobs.begin(), E = Jobs.end(); I != E; - ++I) { - if ((*I)->getKind() == driver::Job::CommandClass) { - const driver::Command &Cmd = cast(**I); + for (const auto &Job : Jobs) { + if (Job.getKind() == driver::Job::CommandClass) { + const driver::Command &Cmd = cast(Job); // Collect only for Assemble jobs. If we do all jobs we get duplicates // since Link jobs point to Assemble jobs as inputs. if (Cmd.getSource().getKind() == driver::Action::AssembleJobClass) -- cgit v1.2.3