From 02e25119b15a6f619f17db99f5d05124a5807ff3 Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Wed, 14 Aug 2013 16:14:24 -0700 Subject: Fix up TODO: c++0x, update cpplint. Needed to update cpplint to handle const auto. Fixed a few cpplint errors that were being missed before. Replaced most of the TODO c++0x with ranged based loops. Loops which do not have a descriptive container name have a concrete type instead of auto. Change-Id: Id7cc0f27030f56057c544e94277300b3f298c9c5 --- compiler/driver/compiler_driver.cc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'compiler/driver/compiler_driver.cc') diff --git a/compiler/driver/compiler_driver.cc b/compiler/driver/compiler_driver.cc index b8727fe103..0ef0428619 100644 --- a/compiler/driver/compiler_driver.cc +++ b/compiler/driver/compiler_driver.cc @@ -664,8 +664,7 @@ void CompilerDriver::LoadImageClasses(base::TimingLogger& timings) Thread* self = Thread::Current(); ScopedObjectAccess soa(self); ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); - typedef DescriptorSet::iterator It; // TODO: C++0x auto - for (It it = image_classes_->begin(), end = image_classes_->end(); it != end;) { + for (auto it = image_classes_->begin(), end = image_classes_->end(); it != end;) { std::string descriptor(*it); SirtRef klass(self, class_linker->FindSystemClass(descriptor.c_str())); if (klass.get() == NULL) { @@ -687,12 +686,9 @@ void CompilerDriver::LoadImageClasses(base::TimingLogger& timings) unresolved_exception_types.clear(); class_linker->VisitClasses(ResolveCatchBlockExceptionsClassVisitor, &unresolved_exception_types); - typedef std::set >::const_iterator It; // TODO: C++0x auto - for (It it = unresolved_exception_types.begin(), - end = unresolved_exception_types.end(); - it != end; ++it) { - uint16_t exception_type_idx = it->first; - const DexFile* dex_file = it->second; + for (const std::pair& exception_type : unresolved_exception_types) { + uint16_t exception_type_idx = exception_type.first; + const DexFile* dex_file = exception_type.second; mirror::DexCache* dex_cache = class_linker->FindDexCache(*dex_file); mirror:: ClassLoader* class_loader = NULL; SirtRef klass(self, class_linker->ResolveType(*dex_file, exception_type_idx, -- cgit v1.2.3-59-g8ed1b