mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
When cloning the clang instance in ClangImporter to perform tasks like PCM/PCH compilation, make two compiler instance to share the same CASOptions so they can share the CAS ObjectStore and life time. This fixes a case where clang emits a diagnostics in a source buffer that gets mapped in via CAS, and mapped into swift source manager. While CAS has the ownship from CompilerInvocation -> CASOptions -> CAS, if the CompilerInvocation is deleted when the cloned instance is deleted, it left an invalid buffer in the swift source manager. rdar://141284501
2.0 KiB
2.0 KiB