From b2831dbff741d7c1f6acc438fac69b919abfb2b1 Mon Sep 17 00:00:00 2001 From: Sebastian Redl Date: Tue, 20 Jul 2010 22:55:31 +0000 Subject: [PATCH] Apparently not every system thinks that references in pairs are as cool as I think. llvm-svn: 108959 --- clang/include/clang/Frontend/PCHReader.h | 2 +- clang/lib/Frontend/PCHReader.cpp | 4 ++-- clang/lib/Frontend/PCHReaderDecl.cpp | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/clang/include/clang/Frontend/PCHReader.h b/clang/include/clang/Frontend/PCHReader.h index 4ef7bf19aa03..f2ce6aec31e7 100644 --- a/clang/include/clang/Frontend/PCHReader.h +++ b/clang/include/clang/Frontend/PCHReader.h @@ -543,7 +543,7 @@ private: llvm::BitstreamCursor &SLocCursorForID(unsigned ID); bool ParseLanguageOptions(const llvm::SmallVectorImpl &Record); - typedef std::pair RecordLocation; + typedef std::pair RecordLocation; QualType ReadTypeRecord(unsigned Index); RecordLocation TypeCursorForIndex(unsigned Index); diff --git a/clang/lib/Frontend/PCHReader.cpp b/clang/lib/Frontend/PCHReader.cpp index 532ba444a2da..008f58eaea7a 100644 --- a/clang/lib/Frontend/PCHReader.cpp +++ b/clang/lib/Frontend/PCHReader.cpp @@ -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. diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index a4c0d8df9a31..8ea75b727066 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -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);