diff options
author | Chris Lattner <sabre@nondot.org> | 2009-04-27 06:03:19 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-04-27 06:03:19 +0000 |
commit | 02602be3ccc3b29da5b91d2502c3419404992409 (patch) | |
tree | b07f39898eb2f1800208c657d28edfee5321a2e4 | |
parent | 4e3fcc845b43a890f660a8abcee5e358882c5e8e (diff) |
unclone SavedStreamPosition
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70192 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/clang/Frontend/PCHReader.h | 15 | ||||
-rw-r--r-- | lib/Frontend/PCHReader.cpp | 17 | ||||
-rw-r--r-- | lib/Frontend/PCHReaderDecl.cpp | 18 |
3 files changed, 15 insertions, 35 deletions
diff --git a/include/clang/Frontend/PCHReader.h b/include/clang/Frontend/PCHReader.h index ecfc506169..a4304461f8 100644 --- a/include/clang/Frontend/PCHReader.h +++ b/include/clang/Frontend/PCHReader.h @@ -470,6 +470,21 @@ public: void SetLabelOf(AddrLabelExpr *S, unsigned ID); }; +/// \brief Helper class that saves the current stream position and +/// then restores it when destroyed. +struct SavedStreamPosition { + explicit SavedStreamPosition(llvm::BitstreamCursor &Cursor) + : Cursor(Cursor), Offset(Cursor.GetCurrentBitNo()) { } + + ~SavedStreamPosition() { + Cursor.JumpToBit(Offset); + } + +private: + llvm::BitstreamCursor &Cursor; + uint64_t Offset; +}; + } // end namespace clang #endif diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp index 5a018e4806..86848758ad 100644 --- a/lib/Frontend/PCHReader.cpp +++ b/lib/Frontend/PCHReader.cpp @@ -33,23 +33,6 @@ #include <cstdio> using namespace clang; -namespace { - /// \brief Helper class that saves the current stream position and - /// then restores it when destroyed. - struct VISIBILITY_HIDDEN SavedStreamPosition { - explicit SavedStreamPosition(llvm::BitstreamCursor &Cursor) - : Cursor(Cursor), Offset(Cursor.GetCurrentBitNo()) { } - - ~SavedStreamPosition() { - Cursor.JumpToBit(Offset); - } - - private: - llvm::BitstreamCursor &Cursor; - uint64_t Offset; - }; -} - //===----------------------------------------------------------------------===// // PCH reader implementation //===----------------------------------------------------------------------===// diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp index c279a21713..508d2ef170 100644 --- a/lib/Frontend/PCHReaderDecl.cpp +++ b/lib/Frontend/PCHReaderDecl.cpp @@ -20,24 +20,6 @@ #include "clang/AST/Expr.h" using namespace clang; -// FIXME: Temporarily cloned from PCHReader.cpp. -namespace { - /// \brief Helper class that saves the current stream position and - /// then restores it when destroyed. - struct SavedStreamPosition { - explicit SavedStreamPosition(llvm::BitstreamCursor &Cursor) - : Cursor(Cursor), Offset(Cursor.GetCurrentBitNo()) { } - - ~SavedStreamPosition() { - Cursor.JumpToBit(Offset); - } - - private: - llvm::BitstreamCursor &Cursor; - uint64_t Offset; - }; -} - //===----------------------------------------------------------------------===// // Declaration deserialization |