1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

Support: Add postincrement and include guards to LineIterator

llvm-svn: 204279
This commit is contained in:
Justin Bogner 2014-03-19 22:58:31 +00:00
parent 3b9d5414df
commit ccdedcd04f

View File

@ -7,6 +7,9 @@
// //
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
#ifndef LLVM_SUPPORT_LINEITERATOR_H__
#define LLVM_SUPPORT_LINEITERATOR_H__
#include "llvm/ADT/StringRef.h" #include "llvm/ADT/StringRef.h"
#include <iterator> #include <iterator>
@ -53,6 +56,11 @@ public:
advance(); advance();
return *this; return *this;
} }
line_iterator operator++(int) {
line_iterator tmp(*this);
advance();
return tmp;
}
/// \brief Get the current line as a \c StringRef. /// \brief Get the current line as a \c StringRef.
StringRef operator*() const { return CurrentLine; } StringRef operator*() const { return CurrentLine; }
@ -72,3 +80,5 @@ private:
void advance(); void advance();
}; };
} }
#endif // LLVM_SUPPORT_LINEITERATOR_H__