summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Path.cpp
diff options
context:
space:
mode:
authorFilipe Cabecinhas <me@filcab.net>2016-04-29 16:48:07 +0000
committerFilipe Cabecinhas <me@filcab.net>2016-04-29 16:48:07 +0000
commit7894938a45c9b57816345a29d26ebd1083d88992 (patch)
tree0d48c1562de85392b04a49f463628e89c38e20b9 /llvm/lib/Support/Path.cpp
parent362dcf9615a6e91d098563756d7930e679aef0b6 (diff)
downloadbcm5719-llvm-7894938a45c9b57816345a29d26ebd1083d88992.tar.gz
bcm5719-llvm-7894938a45c9b57816345a29d26ebd1083d88992.zip
Add operator- to Path's reverse_iterator. Needed for D19666
Reviewers: rafael, craig.topper, bogner Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19724 llvm-svn: 268062
Diffstat (limited to 'llvm/lib/Support/Path.cpp')
-rw-r--r--llvm/lib/Support/Path.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/Path.cpp b/llvm/lib/Support/Path.cpp
index 875bf75b1f0..f9a71b986a8 100644
--- a/llvm/lib/Support/Path.cpp
+++ b/llvm/lib/Support/Path.cpp
@@ -353,6 +353,10 @@ bool reverse_iterator::operator==(const reverse_iterator &RHS) const {
Position == RHS.Position;
}
+ptrdiff_t reverse_iterator::operator-(const reverse_iterator &RHS) const {
+ return Position - RHS.Position;
+}
+
StringRef root_path(StringRef path) {
const_iterator b = begin(path),
pos = b,
OpenPOWER on IntegriCloud