Commit Graph

15 Commits

Author SHA1 Message Date
Finagolfin
d5bd790d05 [test] Check that the C/C++ module maps are looked for in -resource-dir before -sdk, as changed in #74814
Also, dump the module map paths when `-Xfrontend -dump-clang-diagnostics` is
passed in, both so we can check that manually and in these tests, and fix
another Frontend test to be more specific now that this other output trips it up.
2024-08-30 02:37:57 +05:30
Arnold Schwaighofer
609428cad9 IRGen: disable-llvm-optzns should disable the objc-arc-contract pass
Don't run the objc-arc-contract pass when disable-llvm-optzns is passed.

In pipeline setups where the swift-frontend is called twice;
- the first time to create bitcode
- the second time to generate object code from the bitcode (using
  disable-llvm-optzns)
we don't want to run the objc-arc-contract pass twice.

rdar://91908312
2022-04-18 13:47:10 -07:00
Ben Langmuir
63963ab6fe [test] Update uses of llvm-objdump to --long options
Adapt to llvm upstream commit 5c3ec7dc41f3e15c39a193b45f3cf23255de00a2
to fix the master-next tests.
2020-03-16 11:57:08 -07:00
Arnold Schwaighofer
f21f3758ba embed-bitcode.ll test: Use -Xllvm -debug-pass=Structure to dump the LLVM
passes

The test case looks for the Objective C ARC contraction pass. It uses
-Xllvm  -time-passes and then greps for the pass.  It seems that
-time-passes is not always printing the pass. Use -Xllvm
-debug-pass=Structure instead that should print the added passes
reliably.

rdar://35796399
2017-12-01 11:20:01 -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
Jordan Rose
65391ccac5 [ClangImporter] Don't pass API notes options when compiling bitcode. (#10422)
Avoids a bogus "argument unused" warning, since bitcode compilation
doesn't bother to set up much of a Clang AST context. (-embed-bitcode
compiles in two steps: source -> bitcode, then bitcode -> object
file. This is about the second step.)

Patch by Bob Wilson, who's currently on vacation but wanted this to
get in sooner rather than later.

rdar://problem/31372950
2017-06-20 16:02:34 -07:00
Bob Wilson
bdd7138ffc Update embedded bitcode support to work with llvm r269706.
The original support for embedded bitcode used appending linkage for the
magic internal variables that hold the bitcode and command line options,
but that private linkage is a better fit. The only real reason for
appending linkage was to prevent those variables from being optimized away.
r269706 limits the use of appending linkage so that it cannot be used for
those variables, so this switches to use private linkage and keep the
variables alive with llvm.compiler.used. This is basically copied from
clang r269679. rdar://problem/28685198.

As of the swift-3.1-branch versions of Clang/LLVM, embedded bitcode is now
working well enough that the tests can be reenabled. rdar://problem/26247134
2016-10-09 22:54:40 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
Michael Gottesman
8e9ab12b3d Add two requires lines that for some reason escaped my initial commit of the stable merge.
This is due to embed-bitcode not being upstreamed.
2015-11-12 09:51:22 -08:00
Michael Gottesman
48814dafd5 Update commandline options passed to llvm-objdump for upstream changes. 2015-11-11 16:07:41 -08:00
Michael Gottesman
873c8f4cac Add missing llvm datalayout to two tests.
Swift SVN r31816
2015-09-09 04:37:39 +00:00
Jordan Rose
0e3e08f0c6 [ClangImporter] Use Clang's -fembed-bitcode mode when under -embed-bitcode.
This should have no functionality change, but is supposed to keep us from
accidentally relying on the "full" Clang importer when in a backend job.
I tested it by archiving a little iOS app from a developer.

Unfortunately, part of the motivation here was that we'd get error messages when
we pass something Clang doesn't like, and that doesn't seem to be happening.

rdar://problem/21389553

Swift SVN r30407
2015-07-20 17:23:51 +00:00
Manman Ren
0f7fb29331 [bitcode] use __swift_cmdline instead of __cmdline to differentiate from clang.
Swift SVN r25716
2015-03-03 20:00:19 +00:00
Manman Ren
9d680564db [Driver] fix support for -embed-bitcode-marker.
Move helper function EmbedBitcode() from frontend_main.cpp to IRGen.cpp so we
can call it from performIRGeneration when the input file is Swift.

Add testing case to make sure that -embed-bitcode-marker option adds an
empty LLVM bitcode section.

rdar://19048891


Swift SVN r25577
2015-02-27 00:37:35 +00:00
Manman Ren
48fa3d2e21 [Driver] actually embed bitcode and command line arguments for -embed-bitcode.
With -embed-bitcode, save a copy of the llvm IR as data in the __LLVM,__bitcode
section and save the command-line options in the __LLVM,__cmdline section.

rdar://19048891


Swift SVN r25560
2015-02-26 20:29:46 +00:00