From: Chris Lattner Date: Mon, 27 Apr 2009 06:03:19 +0000 (+0000) Subject: unclone SavedStreamPosition X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=02602be3ccc3b29da5b91d2502c3419404992409;p=clang unclone SavedStreamPosition git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70192 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 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