Support: Add postincrement and include guards to LineIterator
authorJustin Bogner <mail@justinbogner.com>
Wed, 19 Mar 2014 22:58:31 +0000 (22:58 +0000)
committerJustin Bogner <mail@justinbogner.com>
Wed, 19 Mar 2014 22:58:31 +0000 (22:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204279 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/LineIterator.h

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