Use iterators to access stack map data.

Try to simplify the code using the recently added iterators.

Test: test-art-host-gtest-stack_map_test
Change-Id: I0b9f54df01749ee6ec3a67cfb07ba636a2489c89
diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h
index a7adab5..3d78943 100644
--- a/compiler/debug/elf_debug_line_writer.h
+++ b/compiler/debug/elf_debug_line_writer.h
@@ -101,9 +101,7 @@
         // Use stack maps to create mapping table from pc to dex.
         const CodeInfo code_info(mi->code_info);
         pc2dex_map.reserve(code_info.GetNumberOfStackMaps());
-        for (uint32_t s = 0; s < code_info.GetNumberOfStackMaps(); s++) {
-          StackMap stack_map = code_info.GetStackMapAt(s);
-          DCHECK(stack_map.IsValid());
+        for (StackMap stack_map : code_info.GetStackMaps()) {
           const uint32_t pc = stack_map.GetNativePcOffset(isa);
           const int32_t dex = stack_map.GetDexPc();
           pc2dex_map.push_back({pc, dex});