summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShankar Easwaran <shankare@codeaurora.org>2015-03-17 02:12:35 +0000
committerShankar Easwaran <shankare@codeaurora.org>2015-03-17 02:12:35 +0000
commitd9c4c2487f42265f6c64102d99c006903f7499b8 (patch)
treee5da1d02be0e378f6450b3e816e85b4d38f2bc17
parent1ac93a5d89d93ee632af7574492a84f8c5e473b9 (diff)
downloadbcm5719-llvm-d9c4c2487f42265f6c64102d99c006903f7499b8.tar.gz
bcm5719-llvm-d9c4c2487f42265f6c64102d99c006903f7499b8.zip
[Object][ELF] ELFEntityIterator : Add operators for random access
Add operators add/subtract for random access. This is essentially used by lld. llvm-svn: 232453
-rw-r--r--llvm/include/llvm/Object/ELF.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/llvm/include/llvm/Object/ELF.h b/llvm/include/llvm/Object/ELF.h
index 8a5105f5a4b..0202e069905 100644
--- a/llvm/include/llvm/Object/ELF.h
+++ b/llvm/include/llvm/Object/ELF.h
@@ -94,6 +94,18 @@ public:
return *this;
}
+ ELFEntityIterator &operator+(difference_type n) {
+ assert(Current && "Attempted to increment an invalid iterator!");
+ Current += n;
+ return *this;
+ }
+
+ ELFEntityIterator &operator-(difference_type n) {
+ assert(Current && "Attempted to subtract an invalid iterator!");
+ Current -= n;
+ return *this;
+ }
+
ELFEntityIterator operator ++(int) {
ELFEntityIterator Tmp = *this;
++*this;
OpenPOWER on IntegriCloud