aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/MultiplexExternalSemaSource.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2015-03-26 09:08:15 +0000
committerChandler Carruth <chandlerc@gmail.com>2015-03-26 09:08:15 +0000
commit52cee4dad2de9bed6f552b74391f20c84aee3622 (patch)
treee7e9bb35da701f6180968505cda2fe1a6383fb69 /clang/lib/Sema/MultiplexExternalSemaSource.cpp
parent70a1369b342e2c3cd39cef7ec70d9115ca63483c (diff)
downloadllvm-52cee4dad2de9bed6f552b74391f20c84aee3622.zip
llvm-52cee4dad2de9bed6f552b74391f20c84aee3622.tar.gz
llvm-52cee4dad2de9bed6f552b74391f20c84aee3622.tar.bz2
[Modules] Preserve source order for the map of late parsed templates.
Clang was inserting these into a dense map. While it never iterated the dense map during normal compilation, it did when emitting a module. Fix this by using a standard MapVector to preserve the order in which we encounter the late parsed templates. I suspect this still isn't ideal, as we don't seem to remove things from this map even when we mark the templates as no longer late parsed. But I don't know enough about this particular extension to craft a nice, subtle test case covering this. I've managed to get the stress test to at least do some late parsing and demonstrate the core problem here. This patch fixes the test and provides deterministic behavior which is a strict improvement over the prior state. I've cleaned up some of the code here as well to be explicit about inserting when that is what is actually going on. llvm-svn: 233264
Diffstat (limited to 'clang/lib/Sema/MultiplexExternalSemaSource.cpp')
-rw-r--r--clang/lib/Sema/MultiplexExternalSemaSource.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/MultiplexExternalSemaSource.cpp b/clang/lib/Sema/MultiplexExternalSemaSource.cpp
index bd7e785..51a1274 100644
--- a/clang/lib/Sema/MultiplexExternalSemaSource.cpp
+++ b/clang/lib/Sema/MultiplexExternalSemaSource.cpp
@@ -276,7 +276,7 @@ void MultiplexExternalSemaSource::ReadPendingInstantiations(
}
void MultiplexExternalSemaSource::ReadLateParsedTemplates(
- llvm::DenseMap<const FunctionDecl *, LateParsedTemplate *> &LPTMap) {
+ llvm::MapVector<const FunctionDecl *, LateParsedTemplate *> &LPTMap) {
for (size_t i = 0; i < Sources.size(); ++i)
Sources[i]->ReadLateParsedTemplates(LPTMap);
}