[cfe-commits] r70192 - in /cfe/trunk: include/clang/Frontend/PCHReader.h lib/Frontend/PCHReader.cpp lib/Frontend/PCHReaderDecl.cpp

Chris Lattner sabre at nondot.org
Sun Apr 26 23:03:19 PDT 2009


Author: lattner
Date: Mon Apr 27 01:03:19 2009
New Revision: 70192

URL: http://llvm.org/viewvc/llvm-project?rev=70192&view=rev
Log:
unclone SavedStreamPosition

Modified:
    cfe/trunk/include/clang/Frontend/PCHReader.h
    cfe/trunk/lib/Frontend/PCHReader.cpp
    cfe/trunk/lib/Frontend/PCHReaderDecl.cpp

Modified: cfe/trunk/include/clang/Frontend/PCHReader.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Frontend/PCHReader.h?rev=70192&r1=70191&r2=70192&view=diff

==============================================================================
--- cfe/trunk/include/clang/Frontend/PCHReader.h (original)
+++ cfe/trunk/include/clang/Frontend/PCHReader.h Mon Apr 27 01:03:19 2009
@@ -470,6 +470,21 @@
   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

Modified: cfe/trunk/lib/Frontend/PCHReader.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReader.cpp?rev=70192&r1=70191&r2=70192&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReader.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReader.cpp Mon Apr 27 01:03:19 2009
@@ -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
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/Frontend/PCHReaderDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderDecl.cpp?rev=70192&r1=70191&r2=70192&view=diff

==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderDecl.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderDecl.cpp Mon Apr 27 01:03:19 2009
@@ -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





More information about the cfe-commits mailing list