[Frontend] Only enable request reference tracking when needed

Only enable when we have a reference dependency output, or are
validating dependencies or collecting statistics. This avoids enabling
for SourceKit.
This commit is contained in:
Hamish Knight
2025-09-12 20:39:58 +01:00
parent 850118c856
commit 46a093a100
2 changed files with 19 additions and 4 deletions

View File

@@ -40,3 +40,10 @@
// NOOUTPUT_ARGS-DAG: -typecheck
// NOOUTPUT_ARGS-DAG: -module-name
// NOOUTPUT_ARGS: Frontend Arguments END
// Make sure that '-incremental' is ignored, we don't want SourceKit to run with
// reference dependency tracking enabled. The legacy driver simply doesn't
// implement incremental compilation, but make sure when we switch to the new
// driver this doesn't start failing.
// RUN: %swift-ide-test_plain -test-createCompilerInvocation -incremental %S/Input/main.swift | %FileCheck --check-prefix INCREMENTAL %s
// INCREMENTAL-NOT: emit-reference-dependencies