aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReaderDecl.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-07-27 18:24:41 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-07-27 18:24:41 +0000
commitd692af71226d2fb537d86c670af96114ddd485c3 (patch)
tree911bdd7619417c34757323f4b31000c0529d6039 /lib/Frontend/PCHReaderDecl.cpp
parentb698688fe116ef6fc4711798af7292537f4d0d12 (diff)
Update the list of lexical decls in the TU for chained PCHs. This makes -ast-print show the decls from the dependent PCH.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@109524 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReaderDecl.cpp')
-rw-r--r--lib/Frontend/PCHReaderDecl.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/Frontend/PCHReaderDecl.cpp b/lib/Frontend/PCHReaderDecl.cpp
index 6f6ed84df7..fe2947d64f 100644
--- a/lib/Frontend/PCHReaderDecl.cpp
+++ b/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());