Introduce local -> global selector ID mapping into the AST
reader. Tested with the usual "gaps" method.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136839 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Serialization/ASTReaderDecl.cpp b/lib/Serialization/ASTReaderDecl.cpp
index f9a99fc..1f350f3 100644
--- a/lib/Serialization/ASTReaderDecl.cpp
+++ b/lib/Serialization/ASTReaderDecl.cpp
@@ -1407,7 +1407,8 @@
GlobalDeclMapType::iterator I = GlobalDeclMap.find(ID);
assert(I != GlobalDeclMap.end() && "Corrupted global declaration map");
Module *M = I->second;
- return RecordLocation(M, M->DeclOffsets[ID - M->BaseDeclID - 1]);
+ return RecordLocation(M,
+ M->DeclOffsets[ID - M->BaseDeclID - NUM_PREDEF_DECL_IDS]);
}
ASTReader::RecordLocation ASTReader::getLocalBitOffset(uint64_t GlobalOffset) {