Commit Graph

10 Commits

Author SHA1 Message Date
Allan Shortlidge
cfe9f90347 Merge pull request #84244 from tshortli/require-swift-version-in-module-interfaces
Frontend: Require `-language-mode` option when emitting swiftinterfaces
2025-09-15 10:08:23 -07:00
Hamish Knight
46a093a100 [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.
2025-09-12 20:39:58 +01:00
Allan Shortlidge
13d61b0709 Frontend: Require -language-mode option when emitting swiftinterfaces.
If a `.swiftinterface` file does not include an explicit `-language-mode`
option (or its predecessor `swift-version`) and needs to be built as a
dependency of a client compilation, then the invocation to build the module
from interface would end up inheriting the language mode that the client code
is built with. This can result in spurious type checking diagnostics or even
mis-compilation. To ensure that a module interface is always built using the
language mode that its source code was originally built with, require an
explicit `-language-mode` option when emitting swiftinterface files.

Resolves rdar://145168219.
2025-09-12 09:10:23 -07:00
Ben Langmuir
251dbb9b8c [driver] Improve handling of supplementary outputs in createCompilerInvocation
Mark the relevant options in Options.td rather than hard-coding the
list in code, and handle a few more options suggested during the review.
2020-06-01 14:00:39 -07:00
Ben Langmuir
cccb21aca6 [driver] Add test for new behaviour in createCompilerInvocation
Test for "ForceNoOutputs" flag.
2020-05-19 13:58:05 -07:00
Ben Langmuir
8ea2d0dded [BatchMode] Avoid spurious warnings in sourcekitd and indexing
Explicitly disable batch mode in createCompilerInvocation, since it uses
-force-single-frontend-invocation.  Previously we were getting spurious
warnings.  Also add a test that -disable-batch-mode will allow commands
that use -index-file to avoid the same warning, since that is likely
what they want to do as well.

rdar://39581506
2018-04-20 11:28:13 -07:00
David Farler
b7d17b25ba Rename -parse flag to -typecheck
A parse-only option is needed for parse performance tracking and the
current option also includes semantic analysis.
2016-11-28 10:50:55 -08:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Dmitri Hrybenko
1eea220932 Use one module cache directory for all the lit tests to speed them up
Doing so is safe even though we have mock SDK.  The include paths for
modules with the same name in the real and mock SDKs are different, and
the module files will be distinct (because they will have a different
hash).

This reduces test runtime on OS X by 30% and brings it under a minute on
a 16-core machine.

This also uncovered some problems with some tests -- even when run for
iOS configurations, some tests would still run with macosx triple.  I
fixed the tests where I noticed this issue.

rdar://problem/19125022

Swift SVN r23683
2014-12-04 11:21:48 +00:00
Connor Wakamo
6e6e20ab4b [test] Added an integrated "-test-createCompilerInvocation" tool to swift-ide-test.
This is very basic: it just sees whether, given a set of driver arguments, the
swift::driver::createCompilerInvocation API returns a non-null
CompilerInvocation.

Unlike other modes of swift-ide-test, this mode requires that
"-test-createCompilerInvocation" be the first argument passed to swift-ide-test.
This is because it is handled separately from llvm::cl::ParseCommandLineOptions
so the remaining arguments can be passed through directly to
swift::driver::createCompilerInvocation without any interference from that
parser.

Additionally, added a test which uses this tool to try to create a
CompilerInvocation for a handful of basic driver commands.

Swift SVN r20973
2014-08-03 19:04:27 +00:00