aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/clang/Frontend/PCHReader.h15
-rw-r--r--lib/Frontend/PCHReader.cpp17
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp18
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