[Embedded] Do not produce cannot_specialize_class for live issues

SourceKit explicitly disables WMO, silence the diagnostic in this case
(but leave it enabled for explicit non-WMO builds otherwise).
This commit is contained in:
Ben Barham
2024-12-19 15:31:41 -08:00
parent ddfb26b1c6
commit a2fda1d9f3
8 changed files with 30 additions and 11 deletions

View File

@@ -1215,9 +1215,8 @@ ASTUnitRef ASTBuildOperation::buildASTUnit(std::string &Error) {
llvm::SaveAndRestore<std::shared_ptr<std::atomic<bool>>> DisableCancellationDuringSILGen(CompIns.getASTContext().CancellationFlag, nullptr);
SILOptions SILOpts = Invocation.getSILOptions();
// Disable PerformanceDiagnostics SIL pass, which in some cases requires
// WMO (e.g. for Embedded Swift diags) but SourceKit compiles without WMO.
SILOpts.EnablePerformanceDiagnostics = false;
// Disable diagnostics that require WMO (as SourceKit disables it).
SILOpts.EnableWMORequiredDiagnostics = false;
auto &TC = CompIns.getSILTypes();
std::unique_ptr<SILModule> SILMod = performASTLowering(*SF, TC, SILOpts);