[PCH] Preload the PreloadSLocEntries 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.

llvm-svn: 140052
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index e4f9fa6..6c0afb5 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -2633,9 +2633,11 @@
   // 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);
   }