summaryrefslogtreecommitdiffstats
path: root/llvm/lib/DebugInfo/DWARFDebugArangeSet.h
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-03-13 07:52:54 +0000
committerAlexey Samsonov <samsonov@google.com>2014-03-13 07:52:54 +0000
commit1eabf98b3277cc44e0263c05155791cfe6d2c221 (patch)
treed97ef3fcb847e9b97c5384e116b1a4af20eecdf3 /llvm/lib/DebugInfo/DWARFDebugArangeSet.h
parentaae4dc21ea12d91a2687923755a6eb80dba5f2da (diff)
downloadbcm5719-llvm-1eabf98b3277cc44e0263c05155791cfe6d2c221.tar.gz
bcm5719-llvm-1eabf98b3277cc44e0263c05155791cfe6d2c221.zip
[C++11] Convert DWARF parser to range-based for loops
llvm-svn: 203766
Diffstat (limited to 'llvm/lib/DebugInfo/DWARFDebugArangeSet.h')
-rw-r--r--llvm/lib/DebugInfo/DWARFDebugArangeSet.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/DebugInfo/DWARFDebugArangeSet.h b/llvm/lib/DebugInfo/DWARFDebugArangeSet.h
index 49a713201d1..c18b3c5e504 100644
--- a/llvm/lib/DebugInfo/DWARFDebugArangeSet.h
+++ b/llvm/lib/DebugInfo/DWARFDebugArangeSet.h
@@ -10,6 +10,7 @@
#ifndef LLVM_DEBUGINFO_DWARFDEBUGARANGESET_H
#define LLVM_DEBUGINFO_DWARFDEBUGARANGESET_H
+#include "llvm/ADT/iterator_range.h"
#include "llvm/Support/DataExtractor.h"
#include <vector>
@@ -44,7 +45,7 @@ public:
private:
typedef std::vector<Descriptor> DescriptorColl;
- typedef DescriptorColl::const_iterator DescriptorConstIter;
+ typedef iterator_range<DescriptorColl::const_iterator> desc_iterator_range;
uint32_t Offset;
Header HeaderData;
@@ -57,12 +58,12 @@ public:
void dump(raw_ostream &OS) const;
uint32_t getCompileUnitDIEOffset() const { return HeaderData.CuOffset; }
- uint32_t getNumDescriptors() const { return ArangeDescriptors.size(); }
- const Descriptor *getDescriptor(uint32_t i) const {
- if (i < ArangeDescriptors.size())
- return &ArangeDescriptors[i];
- return NULL;
+
+ desc_iterator_range descriptors() const {
+ return desc_iterator_range(ArangeDescriptors.begin(),
+ ArangeDescriptors.end());
}
+ uint32_t getNumDescriptors() const { return ArangeDescriptors.size(); }
};
}
OpenPOWER on IntegriCloud