Commit Graph

54 Commits

Author SHA1 Message Date
Adrian Prantl
1a06ddc3ba Bump the DWARF version number to 5 on Darwin.
The default debug info format for newer versions of Darwin is DWARF 5.

https://developer.apple.com/documentation/xcode-release-notes/xcode-16-release-notes

rdar://110925733
2024-06-11 14:44:58 -07:00
Artem Chikin
73b01dccfc Remove incremental builds from the Legacy driver
The C++-based driver is deprecated and this will help reduce the code surface that requires maintenance as the legacy driver is fully sunset.
2024-01-16 16:34:51 -08:00
Adrian Prantl
fae0618656 Add more dwarf version driver tests 2023-12-13 09:48:46 -08:00
Adrian Prantl
c512f56934 Add more dwarf version driver tests 2023-12-07 15:44:23 -08:00
Adrian Prantl
5d978b44ca Revert "Revert "Make the DWARF version emitted by the Swift compiler configurable."" 2023-10-26 12:29:18 -07:00
Adrian Prantl
2a32ca5944 Revert "Make the DWARF version emitted by the Swift compiler configurable." 2023-10-25 13:28:28 -07:00
Adrian Prantl
a26bbb0baf Make the DWARF version emitted by the Swift compiler configurable.
Previously it was hardcoded to version 4 on all platforms.
This patch introduces a driver and frontend option -dwarf-version to configure it if needed.
2023-10-24 12:30:16 -07:00
Saleem Abdulrasool
19c7bb5a22 Driver: add support for baremetal targets
This allows building the Swift standard library for targets which may
not have an actual OS running.  This is identified by the OS field in
the target triple being set to `none`.
2023-03-20 17:59:13 -04:00
Mishal Shah
84489d87b2 [Apple Silicon] Mark several tests that require the Swift interpreter accordingly 2020-07-02 16:26:10 -07:00
Doug Gregor
f71f6207b5 [CMake] Make swift-frontend the primary Swift binary.
Build swift-frontend as the primary Swift binary, and have
swift/swiftc/etc. symlink over to it. This is a step toward allowing
swift-driver to replace the swift and swiftc binaries.
2020-06-23 13:00:26 -07:00
Daniel Rodríguez Troitiño
2b0039d568 [android] Switch %swiftc_driver for %target-swiftc_driver
When compiling against a platform different than the host, like it
happens when testing against Android stdlib from a Linux host, one needs
to use %target-swiftc_driver to setup the tools directory correctly and
the target options, otherwise errors will happen when trying to link a
host targetted file against the destination platform libraries.
2020-06-19 13:43:32 -07:00
Daniel Rodríguez Troitiño
70b1d91315 [windows] Allow EXE and exe capitalizations in tests.
Clang 8 or 9 seems to have changed from EXE to exe. Allow both
capitalizations (which is not important in Windows) as a workaround.

Maybe in the future we can remove the uppercase option.
2019-10-03 11:09:03 -07:00
Harlan Haskins
d3b8ce7ae2 [test] Update ParseableInterface to ModuleInterface
Also remove uses of -emit-parseable-module-interface from tests
2019-09-13 14:55:48 -07:00
Saleem Abdulrasool
1d84cb60a8 Driver: loosen restrictions for -force-autolink-symbol
On targets which support COMDAT (PE/COFF, ELF), use that to relax the
constraints on the emission of `-force-autolink-symbol` so that it is
possible to use that with `-incremental`.
2019-08-12 10:54:07 -07:00
Aasim Kandrikar
6328322eea [Driver] Add warning when using -F and path ends in ".framework"
This commit also includes cases where user uses -Fsystem and when path
ends in ".framework/"

(cherry picked from commit a5d9750a9d25441517f3bec97488f57d1bb4b03f)
2019-07-01 22:14:14 +05:30
Harlan Haskins
6d72977642 [test] [ModuleInterfaces] Get tests passing with new diagnostics 2019-04-11 18:05:09 -07:00
Gwen Mittertreiner
8a6d28c7d0 Fix the Rest of the Windows Driver Tests 2019-03-06 14:23:49 -08:00
Jason Mittertreiner
4e0b092fbe Fixing Driver tests on Windows (#20209) 2018-12-10 18:27:37 -08:00
Jordan Rose
45557ee2f6 [Driver] Disallow emitting swiftinterfaces with bridging headers
There's no place to put the bridging header in a swiftinterface, and
they don't make sense with the intended use case of distribution.
Just disallow it up front.

rdar://problem/44113493
2018-10-04 18:02:09 -07:00
Jordan Rose
b88256e7ac [test] Split out the Frontend parts of test/Driver/options.swift
This dates back to the early days when the Driver was still being
brought up, but there's no reason to put them together now.

Reorganization and elimination of redundancy only.
2018-07-19 15:56:55 -07:00
Robert Widmann
2ee7e7c59b -parse and -resolve-imports cannot emit ObjC headers
At least -typecheck is required to be able to emit headers.
2018-07-13 14:56:52 -07:00
Robert Widmann
2282065197 Rename "Name Binding" action to "Resolve Imports" 2018-07-13 11:00:48 -07:00
Robert Widmann
c440b0ba5a Diagnose parse-only invocations trying to emit dependency information
Parse-only invocations do not support the proper creation of dependency files or reference dependency files because they have not yet run name binding.  Ban these invocations by diagnostic and add a new diagnostic specifically for reference dependencies.
2018-07-13 10:56:03 -07:00
Ellis Hoag
c93a5a5776 Add -debug-info-format=[dwarf|codeview] option (#16888) 2018-06-20 09:52:57 -07:00
Jordan Rose
36150a8696 [Driver] Disallow -autolink-force-load with -incremental
6af333f3 changed the implementation of -autolink-force-load to only
generate one symbol, but the /placement/ of that one symbol depends on
the order of input files, and -incremental supports adding a file
without rebuilding all other files. We don't have any need for these
two to play nice together right now, so just disallow it.
2018-04-06 20:06:24 -07:00
David Ungar
724d1c36cd Last round of small changes 2017-12-11 17:19:06 -08:00
David Ungar
28b206008f FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
2017-12-05 17:28:03 -08:00
Erik Eckstein
89ffd4ca29 driver: fix handling of hidden option -assume-single-threaded
It had no effect, because it was not passed to the frontend
2017-11-17 13:33:55 -08:00
Erik Eckstein
416082ccd5 driver: Make -remove-runtime-asserts a driver option, which is passed to the frontend
rdar://problem/35602951
2017-11-17 13:33:55 -08:00
Deyton Sehn
f2447bc1b8 [Driver] Clarify unsupported option message (#11448)
Previously, with the tool and option both included in the suggestion, it
was not immediately clear which of the two was being suggested as a fix.

Resolves SR-5677.
2017-08-15 09:17:36 -07:00
Devin Coughlin
b4b59b424d [Driver] Add command-line flags for enforcement of law of exclusivity
Add an -enforce-exclusivity=... flag to control enforcement of the law of
exclusivity. The flag takes one of four options:

"checked": Perform both static (compile-time) and dynamic (run-time) checks.
"unchecked": Perform only static enforcement. This is analogous to -Ounchecked.
"dynamic-only": Perform only dynamic checks. This is for staging purposes.
"none": Perform no checks at all. This is also for staging purposes.

The default, for now, is "none".

The intent is that in the fullness of time, "checked" and "unchecked" will
be the only legal options with "checked" the default. That is, static
enforcement will always be enabled and dynamic enforcement will be enabled
by default.
2017-03-28 10:54:37 -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
Mark Lacey
bd30572f80 Minor clean-up of -assert-config option handling.
* Replace 'Fast' with 'Unchecked' everywhere.
* Update the help text to specify DisableReplacement rather than
  Replacement and to document Unchecked.
* Simplify tests slightly and add a tests for Unchecked.
2016-02-12 15:10:45 -08:00
Roman Levenstein
0ce9ad9ecd Fix the build: Remove accidentally committed invisible Unicode character 2016-01-07 10:15:49 -08:00
Jordan Rose
cadd851e1b [Driver] Warn when using -incremental without a proper output file map.
Just so people don't try to use it on the command line and then get
surprised.

Swift SVN r25508
2015-02-24 20:02:26 +00:00
Jordan Rose
9a9a6969b7 [Driver] Error if we don't support the target we're given.
Also, normalize the target triple up front, so that we're never dealing
with non-normalized triples in the driver unless explicitly asking for
the original user option.

rdar://problem/18065292

Swift SVN r24563
2015-01-20 20:42:03 +00:00
Dmitri Hrybenko
3b04d1b013 tests: reorganize tests so that they actually use the target platform
Most tests were using %swift or similar substitutions, which did not
include the target triple and SDK.  The driver was defaulting to the
host OS.  Thus, we could not run the tests when the standard library was
not built for OS X.

Swift SVN r24504
2015-01-19 06:52:49 +00:00
Jordan Rose
49a6c8eb7b Do all target info management in Clang, and drop -target-abi / -target-feature.
Previously we hardcoded a few important default CPUs, ABIs, and features into
Swift's driver, duplicating work in Clang. Now that we're using Clang's
driver to create the Clang "sub-compiler", we can delegate this work to Clang.

As part of this, I've dropped the options for -target-abi (which was a
frontend-only option anyway) and -target-feature (which was a hidden driver
option and is a frontend-only option in /Clang/). We can revisit this later
if it becomes interesting. I left in -target-cpu, which is now mapped
directly to Clang's -mcpu=.

Swift SVN r22449
2014-10-01 23:55:40 +00:00
Ben Langmuir
d197964680 Rename -integrated-repl to -deprecated-integrated-repl
Swift SVN r20781
2014-07-30 22:09:37 +00:00
Ben Langmuir
920a8ff343 Make using the -i flag an error
This flag is now obsoleted by the interactive driver and simply
complicates understanding the command-line parsing. Making it an error
to force users to move also allows us to reuse the flag in the future if
we like.

Swift SVN r20641
2014-07-28 20:19:27 +00:00
Ben Langmuir
d2ef235237 Move the lit tests over to the new swift/swiftc interfaces
Most of the tests just got moved to swiftc, but some of them were
duplicated to apply to both swiftc and swift. A handful still use the
existing 'swift' because they are for the existing '-i' syntax.

Note: this means config.swift_driver now uses the staging symlink
'swifti'. The only thing preventing us from dropping the 'i' and getting
rid of the old interface is that Xcode hasn't moved to swiftc yet
<rdar://problem/17769327>.

Swift SVN r20467
2014-07-24 04:34:10 +00:00
Ben Langmuir
309d00706c Make swiftc default to -emit-executable even with no inputs
Running the repl here doesn't fit with the interactive/batch-compilation
split.

Swift SVN r20453
2014-07-24 01:04:40 +00:00
Ben Langmuir
915657fe3d Introduce NoInteractiveOption and NoBatchOption opt flags
... and use them to start diagnosing unsupported mode flag and
DriverKind combinations (e.g. swifti -c, swiftc -i). Also hide the
unsupported options from -help.

Swift SVN r20452
2014-07-24 01:04:37 +00:00
Ben Langmuir
860b888857 Make a test from r20359 more robust
Don't rely on the order between the forwarded arguments.

Swift SVN r20373
2014-07-23 04:30:06 +00:00
Ben Langmuir
a96009c52f Add a 'swifti' symlink to stage in the upcoming driver changes
For now, keep 'swift' the same and put all the interactive driver
changes under 'swifti'. When these are in good shape, I will remove
swifti and make 'swift' the interactive driver as discussed.

Swift SVN r20359
2014-07-23 02:30:39 +00:00
Jordan Rose
ce51ad0228 [Driver] Set -target-cpu options for x86 targets as well.
Really we need to just bring in Clang's logic for this, but this should
at least bring SSE back for the 32-bit simulator.

<rdar://problem/17283844>

Swift SVN r19834
2014-07-10 22:50:02 +00:00
Chris Lattner
5b49d59c57 Remove the @ from @final and @lazy, the last major piece of
rdar://17168115.

Also, reinstate the ARM driver change and testcase that I removed
in my last patch.


Swift SVN r19790
2014-07-10 06:23:27 +00:00
Chris Lattner
fe95f81397 introduce a new 'DeclModifier' flag on attributes, which mark that the
attribute is a "modifier" of a decl, not an "attribute" and thus shouldn't
be spelt with an @ sign.  Teach the parser to parse "@foo" but reject it with
a nice diagnostic and a fixit if "foo" is a decl modifier.

Move 'dynamic' over to this (since it simplifies some code), and switch the
@optional and @required attributes to be declmodifiers (eliminating their @'s).



Swift SVN r19787
2014-07-10 05:49:10 +00:00
Argyrios Kyrtzidis
8dba1a0b7e [Driver] Set the '-target-cpu' for non-64 arm as well.
Depends on clang r212666.
Fixes rdar://17603166

Swift SVN r19774
2014-07-10 01:29:47 +00:00