Commit Graph

42 Commits

Author SHA1 Message Date
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
Jordan Rose
bb6c62d2ca [Driver] Disallow bridging headers with framework targets.
While this appears to work, it causes problems down the line -- it's a
brittle configuration for debugging, and PrintAsObjC currently doesn't
fail gracefully if you reference a bridging-header-only type in your
public interface.

We definitely want something like this to work some day, but don't have
time to fix it now. Filed <rdar://problem/17615898>.

Swift SVN r19762
2014-07-09 23:58:54 +00:00
Jordan Rose
67f319b747 [Driver] Hook up -emit-dependencies option, but don't do anything with it yet.
Part of <rdar://problem/14899639>

Swift SVN r18044
2014-05-14 00:34:07 +00:00
Ted Kremenek
fad874708e Adjust test cases.
Swift SVN r17964
2014-05-12 22:01:52 +00:00
Dmitri Hrybenko
b9dfab2a8e Rename a driver test to something sane
Swift SVN r6019
2013-07-05 21:02:49 +00:00