diff options
Diffstat (limited to 'clang/lib/Frontend/PCHReaderDecl.cpp')
| -rw-r--r-- | clang/lib/Frontend/PCHReaderDecl.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Frontend/PCHReaderDecl.cpp b/clang/lib/Frontend/PCHReaderDecl.cpp index 6f6ed84df77..fe2947d64f9 100644 --- a/clang/lib/Frontend/PCHReaderDecl.cpp +++ b/clang/lib/Frontend/PCHReaderDecl.cpp @@ -1520,7 +1520,11 @@ Decl *PCHReader::ReadDeclRecord(unsigned Index) { DeclContextInfo Info; if (ReadDeclContextStorage(DeclsCursor, Offsets, Info)) return 0; - DeclContextOffsets[DC].push_back(Info); + DeclContextInfos &Infos = DeclContextOffsets[DC]; + // Reading the TU will happen after reading its update blocks, so we need + // to make sure we insert in front. For all other contexts, the vector + // is empty here anyway, so there's no loss in efficiency. + Infos.insert(Infos.begin(), Info); } } assert(Idx == Record.size()); |

