Commit Graph

26 Commits

Author SHA1 Message Date
Saleem Abdulrasool
8eaf6d55fc test: adjust the tests for swiftc-legacy-driver.exe
When enabling the early swift driver on Windows, these tests need to be
adjusted for the new driver name that is reported. Add an additional
spelling for the driver to accommodate that for the testsuite.
2024-12-02 11:50:57 -08:00
Doug Gregor
480c631209 Linux-specific fixes for the swift-frontend rename.
Hardlinking to a symlink is not permitted, so use "swift-frontend"
instead of "swift" as the hard-link target.

Also, update one Linux-specific test to check for swift-frontend.
2020-06-23 13:17:26 -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
David Zarzycki
5dcc32f98f Remove all uses of -force-single-frontend-invocation
The `-force-single-frontend-invocation` flag predates WMO and is now an
alias for `-whole-module-optimization`. We should use the latter and let
the former fade into history.
2020-05-08 06:37:41 -04: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
Saleem Abdulrasool
67475dced4 Driver: avoid linking against the C++ runtime
Use `clang` rather than `clang++` as the linker driver.  This ensures
that we do not force a C++ runtime on the general code.  This is fine
for now as C++ interop is not yet available for Swift.  This prevents
the accidental mix-and-match of various C++ runtimes.  This can cause
problems on platforms like android where `libstdc++` is an unsupported
runtime but is generally the default for Linux platforms.
2019-07-24 19:48:02 -07:00
Jason Mittertreiner
4e0b092fbe Fixing Driver tests on Windows (#20209) 2018-12-10 18:27:37 -08:00
Keith Smiley
7f3804683b Add warning for bitcode marker without object (#18304)
Previously if you passed `-embed-bitcode-marker` to a command that
wasn't producing an object file, it would silently be ignored. This
change puts it inline with `-embed-bitcode` in this same case, which
generates a warning.
2018-07-30 11:24:09 -07:00
David Ungar
17a81f6981 Restore -### functionality for batch-mode by extending OutputLevel. 2018-03-05 11:07:20 -08:00
Jordan Rose
30589d608b [Driver] Use simpler idiom for forwarding -target-cpu
No functionality change, but now at least we're testing this more
explicitly than just in test/Misc/tbi.sil.
2017-11-16 13:58:47 -08:00
Jordan Rose
23897e136c -embed-bitcode: Pass -O options to backend jobs too! (#12971)
Otherwise, we leave optimization opportunities on the table, and in
some cases even fail to remove marker intrinsics inserted by earlier
optimization.

Background: under -embed-bitcode, compilation happens in two stages: a
"frontend" job that compiles Swift code, generates LLVM IR, optimizes
it, and then emits a .bc file; and a "backend" job that takes that
.bc, converts it to assembly, and emits an object file with the
original bitcode embedded. However, there are actually optimization
passes that run before and during that "convert to assembly" step that
were getting completely skipped.

rdar://problem/34864094
2017-11-16 13:45:31 -08:00
Matthew Carroll
69ae6cd588 [Driver] SR-3352: Warn on and ignore -embed-bitcode when not generating object files (#7962)
Commands like -emit-sil and -emit-module (on its own) do not produce object files.
When -embed-bitcode is also set, the driver runs a backend job to generate a module that fails.
This commit emits a warning instead and ignores the -embed-bitcode option.

https://bugs.swift.org/browse/SR-3352
2017-03-07 15:19:08 -08:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Jordan Rose
de2ecbb80e [Driver] Remove the notion of Tools, turn ToolChain into an Action visitor.
The "Tool" abstraction wasn't buying us enough to deserve the added
complexity. Now a ToolChain turns Actions into Jobs, and every helper
tool is searched for relative to Swift first. Much simpler.

Swift SVN r31563
2015-08-28 23:12:33 +00:00
Jordan Rose
208f647bd5 [Driver] Be more explicit about the inputs to the merge-module action.
Previously we treated this the same as the inputs to the linker, but this
was problematic for a few reasons:
- Backend jobs don't produce
- .o inputs never produce .swiftmodule files (obviously).

So now we:
- explicitly track what can produce a swiftmodule
- don't run module merging if there's nothing to merge
- allow linking without a swiftmodule even under -g

Which gets us closer to being able to run the entire test suite with -g.

rdar://problem/22332569

Swift SVN r31376
2015-08-21 02:30:52 +00:00
Jordan Rose
80abf396fc [bitcode] Don't check r29387 on Linux, where it doesn't happen.
Mach-O vs. not isn't really the right check, but it's close enough.

Swift SVN r29390
2015-06-15 22:43:17 +00:00
Jordan Rose
e40dc7fc7a [bitcode] Pass -bitcode_bundle to the linker when linking via swiftc.
...and either -embed-bitcode or -embed-bitcode-marker is passed. This is
the same behavior as Clang.

rdar://problem/20246442

Swift SVN r29387
2015-06-15 20:57:38 +00:00
Jordan Rose
6b59ff8dc5 [bitcode] Don't allow -Xcc or -Xllvm arguments to bitcode backend jobs.
This is consistent with Clang, which rejects -mllvm options. All options
Clang /does/ accept should be covered by normal Swift flags.

rdar://problem/21245117

Swift SVN r29386
2015-06-15 20:57:31 +00:00
Jordan Rose
b041a34d5e [test] Add another -embed-bitcode test with multiple files.
This already works (and isn't testing much beyond CHECK-MODULE, above),
but it's probably good to have a multi-file non-single-frontend test.

Swift SVN r29078
2015-05-27 21:21:42 +00:00
Manman Ren
373b571abf [Bitcode Driver] add testing case for r28146.
rdar://20796819


Swift SVN r28184
2015-05-05 22:50:07 +00:00
Manman Ren
249239e14d [Bitcode Driver] make sure -embed-bitcode works with -force-single-frontend-invocation.
With both force-single-frontend-invocation and embed-bitcode, we create
CompileJobAction and BackendJobAction, similar to how we handle embed-bitcode
with StandarCompile.

This commit should only affect Bitcode mode.

rdar://20796819


Swift SVN r28129
2015-05-04 19:40:54 +00:00
Manman Ren
7ae5ba82df [Bitcode Driver] make sure -embed-bitcode works with -emit-module.
With both emit-module and embed-bitcode, MergeModule will get the swiftmodule
inputs from CompileJobAction instead of BackendJobAction.

This commit should only affect Bitcode mode since it only touches how we handle
BackendJobAction which is used for Bitcode mode.

rdar://20678489


Swift SVN r27878
2015-04-28 18:43:32 +00:00
Graham Batty
98be432723 Updating tests and flags for linux
Swift SVN r25714
2015-03-03 18:26:20 +00:00
Graham Batty
849b7fda1f Update new tests for linux.
Swift SVN r25605
2015-02-27 19:13:38 +00:00
Manman Ren
68e095b902 [Driver] add -embed-bitcode-marker for bitcode store project.
-embed-bitcode-marker option adds an empty LLVM bitcode section
as a marker for the real LLVM IR.

rdar://19048891


Swift SVN r25561
2015-02-26 20:56:40 +00:00
Manman Ren
391e731796 [Driver] add -embed-bitcode for bitcode store project.
With -embed-bitcode, we will invoke swift twice, once to generate the bitcode
file, the second time to perform code generation on the bitcode file.

For now, -embed-bitcode causes -incremental builds to not be incremental,
because of potential issues of mixing the two.

rdar://19048891


Swift SVN r25559
2015-02-26 19:53:12 +00:00