[C++11] Introduce SectionRef::relocations() to use range-based loops
[oota-llvm.git] / include / llvm / Object / ObjectFile.h
index a3301dbe435ac3fccf3d6c22295b47112a277d52..b01eb000238e9c49074ca41a4acd38dcc91f76fb 100644 (file)
@@ -112,6 +112,10 @@ public:
 
   relocation_iterator relocation_begin() const;
   relocation_iterator relocation_end() const;
+  typedef iterator_range<relocation_iterator> relocation_iterator_range;
+  relocation_iterator_range relocations() const {
+    return relocation_iterator_range(relocation_begin(), relocation_end());
+  }
   section_iterator getRelocatedSection() const;
 
   DataRefImpl getRawDataRefImpl() const;