Skip to content

Conversation

egorzhdan
Copy link
Contributor

An old piece of logic in ClangImporter was trying to limit the number of instantiations for each C++ class template to prevent long compile times. Unfortunately this started causing hard-to-reproduce deserialization errors on large projects which use many different instantiations of std::vector and std::allocator.

The instantiation limit was arbitrary, it serves no real purpose and causes issues. This change removes it.

rdar://158397914

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test Linux

@egorzhdan
Copy link
Contributor Author

@swift-ci please test Windows

@egorzhdan egorzhdan force-pushed the egorzhdan/many-specializations branch from 14cee28 to d23f790 Compare August 18, 2025 11:01
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test Linux

1 similar comment
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test Linux

@egorzhdan egorzhdan force-pushed the egorzhdan/many-specializations branch from d23f790 to 85041e4 Compare September 12, 2025 10:50
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan force-pushed the egorzhdan/many-specializations branch from 56970f9 to 56ad74b Compare September 16, 2025 15:10
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

1 similar comment
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

An old piece of logic in ClangImporter was trying to limit the number of instantiations for each C++ class template to prevent long compile times. Unfortunately this started causing hard-to-reproduce deserialization errors on large projects which use many different instantiations of `std::vector` and `std::allocator`.

The instantiation limit was arbitrary, it serves no real purpose and causes issues. This change removes it.

rdar://158397914
@egorzhdan egorzhdan force-pushed the egorzhdan/many-specializations branch from 56ad74b to fed7373 Compare September 22, 2025 15:17
@egorzhdan
Copy link
Contributor Author

@swift-ci please smoke test

@egorzhdan egorzhdan merged commit b250ef7 into swiftlang:main Sep 22, 2025
3 checks passed
@egorzhdan egorzhdan deleted the egorzhdan/many-specializations branch September 22, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ interop Feature: Interoperability with C++
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants