]> granicus.if.org Git - clang/commitdiff
Apparently not every system thinks that references in pairs are as cool as I think.
authorSebastian Redl <sebastian.redl@getdesigned.at>
Tue, 20 Jul 2010 22:55:31 +0000 (22:55 +0000)
committerSebastian Redl <sebastian.redl@getdesigned.at>
Tue, 20 Jul 2010 22:55:31 +0000 (22:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108959 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Frontend/PCHReader.h
lib/Frontend/PCHReader.cpp
lib/Frontend/PCHReaderDecl.cpp

index 4ef7bf19aa03d8915081b26f8f4821601dc870d5..f2ce6aec31e7235544d1a4ebd48ae026148e9989 100644 (file)
@@ -543,7 +543,7 @@ private:
   llvm::BitstreamCursor &SLocCursorForID(unsigned ID);
   bool ParseLanguageOptions(const llvm::SmallVectorImpl<uint64_t> &Record);
 
-  typedef std::pair<llvm::BitstreamCursor &, uint64_t> RecordLocation;
+  typedef std::pair<llvm::BitstreamCursor *, uint64_t> RecordLocation;
 
   QualType ReadTypeRecord(unsigned Index);
   RecordLocation TypeCursorForIndex(unsigned Index);
index 532ba444a2dafb9ea648f3ebbd2527dfbd7d20eb..008f58eaea7a0575801ed24d709459c972c253c6 100644 (file)
@@ -2160,7 +2160,7 @@ PCHReader::RecordLocation PCHReader::TypeCursorForIndex(unsigned Index) {
     Index -= F->LocalNumTypes;
   }
   assert(F && F->LocalNumTypes > Index && "Broken chain");
-  return RecordLocation(F->DeclsCursor, F->TypeOffsets[Index]);
+  return RecordLocation(&F->DeclsCursor, F->TypeOffsets[Index]);
 }
 
 /// \brief Read and return the type with the given index..
@@ -2171,7 +2171,7 @@ PCHReader::RecordLocation PCHReader::TypeCursorForIndex(unsigned Index) {
 /// IDs.
 QualType PCHReader::ReadTypeRecord(unsigned Index) {
   RecordLocation Loc = TypeCursorForIndex(Index);
-  llvm::BitstreamCursor &DeclsCursor = Loc.first;
+  llvm::BitstreamCursor &DeclsCursor = *Loc.first;
 
   // Keep track of where we are in the stream, then jump back there
   // after reading this type.
index a4c0d8df9a3170be2b373304150e7b852812c7e6..8ea75b727066c08f3cb61852ad5a4c5372f2bd93 100644 (file)
@@ -1264,13 +1264,13 @@ PCHReader::RecordLocation PCHReader::DeclCursorForIndex(unsigned Index) {
     Index -= F->LocalNumDecls;
   }
   assert(F && F->LocalNumDecls > Index && "Broken chain");
-  return RecordLocation(F->DeclsCursor, F->DeclOffsets[Index]);
+  return RecordLocation(&F->DeclsCursor, F->DeclOffsets[Index]);
 }
 
 /// \brief Read the declaration at the given offset from the PCH file.
 Decl *PCHReader::ReadDeclRecord(unsigned Index) {
   RecordLocation Loc = DeclCursorForIndex(Index);
-  llvm::BitstreamCursor &DeclsCursor = Loc.first;
+  llvm::BitstreamCursor &DeclsCursor = *Loc.first;
   // Keep track of where we are in the stream, then jump back there
   // after reading this declaration.
   SavedStreamPosition SavedPosition(DeclsCursor);