mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-12 13:38:21 +00:00
[C++11] Introduce ObjectFile::sections().
Summary: This adds ObjectFile::section_iterator_range, that allows to write range-based for-loops running over all sections of a given file. Several files from lib/ are converted to the new interface. Similar fixes should be applied to a variety of llvm-* tools. Reviewers: rafael Reviewed By: rafael CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3069 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203799 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -289,6 +289,11 @@ public:
|
||||
virtual section_iterator section_begin() const = 0;
|
||||
virtual section_iterator section_end() const = 0;
|
||||
|
||||
typedef iterator_range<section_iterator> section_iterator_range;
|
||||
section_iterator_range sections() const {
|
||||
return section_iterator_range(section_begin(), section_end());
|
||||
}
|
||||
|
||||
virtual library_iterator needed_library_begin() const = 0;
|
||||
virtual library_iterator needed_library_end() const = 0;
|
||||
|
||||
|
Reference in New Issue
Block a user