[C++11] Introduce ObjectFile::symbols() to use range-based loops.
[oota-llvm.git] / include / llvm / Object / ObjectFile.h
index 089f624d3db5b9eb07de4258e6dade4c9c1a590f..790257cdc234b2470178c8d005d176c99d557235 100644 (file)
@@ -286,6 +286,10 @@ protected:
   virtual error_code getLibraryPath(DataRefImpl Lib, StringRef &Res) const = 0;
 
 public:
+  typedef iterator_range<symbol_iterator> symbol_iterator_range;
+  symbol_iterator_range symbols() const {
+    return symbol_iterator_range(symbol_begin(), symbol_end());
+  }
 
   virtual section_iterator section_begin() const = 0;
   virtual section_iterator section_end() const = 0;