]> granicus.if.org Git - clang/commit
[Modules] Preserve source order for the map of late parsed templates.
authorChandler Carruth <chandlerc@gmail.com>
Thu, 26 Mar 2015 09:08:15 +0000 (09:08 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Thu, 26 Mar 2015 09:08:15 +0000 (09:08 +0000)
commit2baeab1242a4c166c56eb5f08f5eaddfeffad2b9
tree7d31de19fa7f445530f8f18b77b7c99cc984deb0
parent010ade63adaab8b8d383c4d1f66da2a75b061758
[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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@233264 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Sema/ExternalSemaSource.h
include/clang/Sema/MultiplexExternalSemaSource.h
include/clang/Sema/Sema.h
include/clang/Serialization/ASTReader.h
lib/Sema/MultiplexExternalSemaSource.cpp
lib/Sema/SemaTemplate.cpp
lib/Serialization/ASTReader.cpp
lib/Serialization/ASTWriter.cpp
test/Modules/stress1.cpp