Commit Graph

1 Commits

Author SHA1 Message Date
Steven Wu
3cc9524bba [ClangImporter] Share CASOptions when cloning CompilerInstance
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
2024-12-12 13:31:34 -08:00