swift
fbb3762c - [cxx-interop] Improve performance of importing C++ namespaces

Commit
4 years ago
[cxx-interop] Improve performance of importing C++ namespaces When ClangImporter calls Clang to import a module, Clang calls `SwiftLookupTableWriter::writeExtensionContents` for each namespace redecl, which called `addEntryToLookupTable` (a few frames omitted) which iterated over all of the namespace redecls, doing duplicate work. This caused the complexity to degrade from linear to quadratic. `SwiftDeclConverter::VisitNamespaceDecl` is still called once per namespace, not per redecl, so we need to iterate over all the redecls there. This dramatically improves the build time for SwiftCompilerSources when importing Clang headers in addition to LLVM headers.
Author
Committer
Parents
Loading