[modules] Rearrange how redeclaration chains are loaded, to remove a walk over
all modules and reduce the number of declarations we load when loading a redeclaration chain. The new approach is: * when loading the first declaration of an entity within a module file, we first load all declarations of the entity that were imported into that module file, and then load all the other declarations of that entity from that module file and build a suitable decl chain from them * when loading any other declaration of an entity, we first load the first declaration from the same module file As before, we complete redecl chains through name lookup where necessary. To make this work, I also had to change the way that template specializations are stored -- it no longer suffices to track only canonical specializations; we now emit all "first local" declarations when emitting a list of specializations for a template. On one testcase with several thousand imported module files, this reduces the total runtime by 72%. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245779 91177308-0d34-0410-b5e6-96231b3b80d8
Showing
- include/clang/Serialization/ASTWriter.h 8 additions, 6 deletionsinclude/clang/Serialization/ASTWriter.h
- lib/Serialization/ASTReader.cpp 1 addition, 4 deletionslib/Serialization/ASTReader.cpp
- lib/Serialization/ASTReaderDecl.cpp 37 additions, 40 deletionslib/Serialization/ASTReaderDecl.cpp
- lib/Serialization/ASTWriter.cpp 17 additions, 57 deletionslib/Serialization/ASTWriter.cpp
- lib/Serialization/ASTWriterDecl.cpp 95 additions, 36 deletionslib/Serialization/ASTWriterDecl.cpp
- test/Modules/cxx-templates.cpp 4 additions, 4 deletionstest/Modules/cxx-templates.cpp
Loading
Please register or sign in to comment