Files
swift-mirror/lib/ClangImporter/SwiftLookupTable.cpp
Egor Zhdan c952fc175b [cxx-interop] Fix lookup of class template instantiations
To fix a crash during deserialization, we need to store the mangled names of C++ class template instantiations in the lookup table.

For example, `std::string` will be serialized as `__CxxTemplateInstNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEE`, and when another instance of the Swift compiler will later attempt to deserialize a decl referencing this instantiation, it will query the `SwiftLookupTable` for a decl with this name. If this instantiation is not referenced from the module that is currently being compiled, Swift will not instantiate `std::string` during typechecking, and the mangled name will be missing from `SwiftLookupTable`, leading to a deserialization failure. This happens when compiling with cross-module optimization enabled, and the current module does not reference `std::string`, but one of its dependencies does.
2022-04-29 21:55:59 +01:00

77 KiB