Reapply [FastISel][AArch64] Make use of the zero register when possible (r215591).
[oota-llvm.git] / lib / DebugInfo / DWARFDebugArangeSet.cpp
index 229376e4a1c724836329e205a461aa6877625cf0..c0a33ceaf24324a0465579a93d153ec30594b884 100644 (file)
@@ -67,7 +67,9 @@ DWARFDebugArangeSet::extract(DataExtractor data, uint32_t *offset_ptr) {
 
     Descriptor arangeDescriptor;
 
-    assert(sizeof(arangeDescriptor.Address) == sizeof(arangeDescriptor.Length));
+    static_assert(sizeof(arangeDescriptor.Address) ==
+                      sizeof(arangeDescriptor.Length),
+                  "Different datatypes for addresses and sizes!");
     assert(sizeof(arangeDescriptor.Address) >= HeaderData.AddrSize);
 
     while (data.isValidOffset(*offset_ptr)) {
@@ -94,9 +96,9 @@ void DWARFDebugArangeSet::dump(raw_ostream &OS) const {
                HeaderData.CuOffset, HeaderData.AddrSize, HeaderData.SegSize);
 
   const uint32_t hex_width = HeaderData.AddrSize * 2;
-  for (DescriptorConstIter pos = ArangeDescriptors.begin(),
-       end = ArangeDescriptors.end(); pos != end; ++pos)
-    OS << format("[0x%*.*" PRIx64 " -", hex_width, hex_width, pos->Address)
+  for (const auto &Desc : ArangeDescriptors) {
+    OS << format("[0x%*.*" PRIx64 " -", hex_width, hex_width, Desc.Address)
        << format(" 0x%*.*" PRIx64 ")\n",
-                 hex_width, hex_width, pos->getEndAddress());
+                 hex_width, hex_width, Desc.getEndAddress());
+  }
 }