don't call ReadSLocEntryRecord() directly because the entry may have
already been loaded in which case calling ReadSLocEntryRecord()
directly would trigger an assertion in SourceManager.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@140052
91177308-0d34-0410-b5e6-
96231b3b80d8
getDecomposedSpellingLocSlowCase(const SrcMgr::SLocEntry *E,
unsigned Offset) const;
void computeMacroArgsCache(SrcMgr::ContentCache *Content, FileID FID);
+
+ friend class ASTReader;
+ friend class ASTWriter;
};
// Preload SLocEntries.
for (unsigned I = 0, N = M->PreloadSLocEntries.size(); I != N; ++I) {
int Index = int(M->PreloadSLocEntries[I] - 1) + F.SLocEntryBaseID;
- ASTReadResult Result = ReadSLocEntryRecord(Index);
- if (Result != Success)
- return Failure;
+ // Load it through the SourceManager and don't call ReadSLocEntryRecord()
+ // directly because the entry may have already been loaded in which case
+ // calling ReadSLocEntryRecord() directly would trigger an assertion in
+ // SourceManager.
+ SourceMgr.getLoadedSLocEntryByID(Index);
}