diff options
| author | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-07-27 18:24:41 +0000 |
|---|---|---|
| committer | Sebastian Redl <sebastian.redl@getdesigned.at> | 2010-07-27 18:24:41 +0000 |
| commit | 4b1f4908606163256443880136bad63ae9eff0f9 (patch) | |
| tree | 332f7f2d9ea43383897b22e9ef5fa9b4c1d5347a /clang/lib/Frontend/PCHReaderDecl.cpp | |
| parent | bd32256e257b07cb448a30399ae5a1ed2aca0c5a (diff) | |
| download | bcm5719-llvm-4b1f4908606163256443880136bad63ae9eff0f9.tar.gz bcm5719-llvm-4b1f4908606163256443880136bad63ae9eff0f9.zip | |
Update the list of lexical decls in the TU for chained PCHs. This makes -ast-print show the decls from the dependent PCH.
llvm-svn: 109524
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()); |

