From 7894938a45c9b57816345a29d26ebd1083d88992 Mon Sep 17 00:00:00 2001 From: Filipe Cabecinhas Date: Fri, 29 Apr 2016 16:48:07 +0000 Subject: 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 --- llvm/lib/Support/Path.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'llvm/lib/Support/Path.cpp') 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, -- cgit v1.2.3