Commit Graph

1646 Commits

Author SHA1 Message Date
Jordan Rose
d0d4286d21 Put modules for 32-bit iOS builds in lib/swift/iphone{os,simulator}/32.
This keeps us from having to deal with fat swiftmodules for now.
In the long run we're hoping to solve this problem with build configurations,
so that a single module file can support multiple architectures.
(See <rdar://problem/15056323>)

<rdar://problem/15204953>

Swift SVN r13135
2014-01-30 03:26:50 +00:00
Jordan Rose
12fb34d60f Eliminate "Immediate" flag from CompilerInvocation.
This adds some ugliness in the current swift binary because we weren't
bothering to set a requested action before, but it keeps things simpler
elsewhere. (Thanks, Connor.)

Swift SVN r13067
2014-01-28 22:20:13 +00:00
Jordan Rose
cb358825d1 [driver] Set the Immediate flag in -i or -repl modes.
This activates a special mode where code is also generated for input files.
We don't really care about this for -i mode, but it makes -repl mode a bit
nicer.

Swift SVN r13044
2014-01-28 03:16:48 +00:00
Jordan Rose
4d69bebc08 [driver] -emit-module is not compatible with -i, -parse, or -repl.
Also, preserve the errors for "at least one input file" and "exactly one
input file".

Swift SVN r13042
2014-01-28 03:16:47 +00:00
Jordan Rose
8dc6098104 [driver] LLVM bitcode is a binary format; don't write it to stdout.
Swift SVN r13040
2014-01-28 03:16:46 +00:00
Jordan Rose
2132bfff49 Replace "-sdk=<path>" with "-sdk <path>" in tests.
Part of the migration to the new driver.

Swift SVN r13027
2014-01-28 01:42:38 +00:00
Connor Wakamo
38e1fd44af [frontend] Added support for -disable-llvm-arc-opts.
Adjusted how this option is handled: it is now set in IRGenOptions. If set,
this prevents the relevant passes from being added at all, instead of making
them no-ops.

Swift SVN r13005
2014-01-27 21:22:46 +00:00
Chris Lattner
2792e55be4 remove the -enable-new-objc-properties staging option, and
simplify some code.


Swift SVN r12976
2014-01-26 23:24:35 +00:00
Connor Wakamo
10ab8e9a87 [frontend] Adjusted the algorithm for determining a fallback module name.
If the OutputFilename points to a directory, fall back to the first
InputFilename.

This matches the behavior of the swift executable, and matches what would be
chosen if we could resolve the correct OutputFilename without knowing the module
name.

Swift SVN r12935
2014-01-24 21:43:20 +00:00
Connor Wakamo
6e77523342 [frontend] Add support for -enable-new-objc-properties to the integrated frontend.
Swift SVN r12928
2014-01-24 19:20:42 +00:00
Connor Wakamo
1ffcba47e8 [frontend] Fixed an issue with the default output filename algorithm.
If the user explicitly specified -module-name, prefer that to the base of the only input filename.
Also fixed an 80-column violation.

Swift SVN r12892
2014-01-24 00:35:17 +00:00
Connor Wakamo
399257e072 [frontend] Added a comment to indicate that the branch for choosing a default output filename should never be used when invoking the frontend via the driver.
Swift SVN r12882
2014-01-23 22:38:00 +00:00
Connor Wakamo
6325d2eac5 [frontend] Made EmitObject the default requested action.
This matches the behavior of the swift executable.

Swift SVN r12881
2014-01-23 22:20:07 +00:00
Connor Wakamo
6348426d3f [frontend] Added support for selecting a default OutputFilename.
If the user did not specify an OutputFilename, or if the user specified a
directory with -o, calculate a default OutputFilename based on the inputs,
module name, and requested action.

This matches the behavior of the swift executable.

Swift SVN r12880
2014-01-23 22:20:06 +00:00
Connor Wakamo
552558d03f [frontend] Removed the separate TargetOptions class.
TargetOptions only contained the target triple, which was duplicated in
IRGenOptions. These could get out-of-sync, which would cause issues during
IRGen. Since nothing was using TargetOptions other than CompilerInvocation,
removed TargetOptions in favor of making IRGenOptions the canonical home of the
target triple.

Swift SVN r12869
2014-01-23 19:07:55 +00:00
Connor Wakamo
b35b8451f4 [frontend] Fixed an issue with auto-detecting SIL input.
Swift SVN r12868
2014-01-23 18:30:54 +00:00
Connor Wakamo
39666501b0 [frontend] Added support for -enable-experimental-patterns to the integrated frontend.
Swift SVN r12867
2014-01-23 18:30:53 +00:00
Connor Wakamo
6dd1532788 [frontend] Added support for -disable-all-runtime-checks to the integrated frontend.
Swift SVN r12866
2014-01-23 18:30:53 +00:00
Jordan Rose
9cb81b0006 [driver] Add support for invoking ld.
swift_driver can now end-to-end compile a Swift file. Try it yourself!

echo 'println("hello")' | swift_driver -

Swift SVN r12840
2014-01-23 02:11:47 +00:00
Connor Wakamo
947f3be6e7 [driver] Removed the limited support for -module-source-list.
This option was never honored, and the main functionality that this option
would have implemented has been subsumed by -output-file-map.

Swift SVN r12800
2014-01-22 22:37:21 +00:00
Connor Wakamo
0a3202a46a [driver] Standardized the names of output-specifying options for secondary outputs.
The new format is "-<option>" and "-<option>-path". As a result:
  - Renamed -serialized-diagnostics-path to -serialize-diagnostics-path.
  - Renamed -module-output-path to -emit-module-path.

Swift SVN r12614
2014-01-20 23:16:22 +00:00
Connor Wakamo
de753a659b [frontend] Added a check to disallow the combination of -i and -primary-file.
Swift SVN r12524
2014-01-18 00:55:47 +00:00
Connor Wakamo
a23b6408a9 [frontend] Added a check to ensure REPL mode is not requested with input files.
Swift SVN r12523
2014-01-18 00:55:46 +00:00
Jordan Rose
11008f0ed1 Split diagnostics out into separate files.
Thanks to the way we've set up our diagnostics engine, there's not actually
a reason for /everything/ to get rebuilt when /one/ diagnostic changes.
I've split them up into five categories for now: Parse, Sema, SIL, IRGen,
and Frontend, plus a set of "Common" diagnostics that are used in multiple
areas of the compiler. We can massage this later.

No functionality change, but should speed up compile times!

Swift SVN r12438
2014-01-17 00:15:12 +00:00
Adrian Prantl
035a1175df Debug info: Ensure that the SDK is emitted if it is implicit. Also do a
slightly better job at quoting.
<rdar://problem/15808224> Point ClangImporter at the right SDK for the target

Swift SVN r12310
2014-01-15 01:51:41 +00:00
Connor Wakamo
3a1810336e [frontend] Implement support for emitting modules with the integrated frontend.
Added support for the -emit-module and -module-output-path options. -emit-module
and -module-output-path function similarly to -serialize-diagnostics and
-serialized-diagnostics-path: notably, -module-output-path implies -emit-module,
but -emit-module can be passed without -module-output-path and a default path
will be determined based on other inputs.

Added support for the -module-link-name option, which specifies the name of the
library to link against when importing the generated module.

Note that support for these options is only implemented in the integrated
frontend; driver-level support for these options is forthcoming.

Swift SVN r12301
2014-01-14 23:38:36 +00:00
Connor Wakamo
00f076daa5 [frontend] Implemented support for emitting serialized diagnostics.
Reworked the -serialize-diagnostics option, so that it is now just a flag
indicating that the frontend should generate serialized diagnostics. The path at
which the diagnostics will be serialized is now specified by the
-serialized-diagnostics-path option, which is a frontend-only option. (The
frontend treats -serialized-diagnostics-path as implying -serialize-diagnostics.)

If -serialize-diagnostics is passed but -serialized-diagnostics-path is not
passed, the frontend will choose an output path from a few default values:

- If the frontend has a non-stdout output path, replace that path's extension
  with .dia.
- If there is a primary input filename, use that input's base name as the base
  name for the serialized diagnostics file.
- Otherwise, use the module name as the base name for the serialized diagnostics
  file.

Added support for setting up a serialized diagnostics DiagnosticConsumer in
frontend_main() if FrontendOptions::SerializedDiagnosticsPath is non-empty.

Swift SVN r12251
2014-01-13 21:38:03 +00:00
Connor Wakamo
0b7569fab7 [frontend] Add proper support for determining the InputKind.
Added checks to determine if the input should be treated as SIL, Library, REPL, or Main, based on the command line arguments and inputs.

Swift SVN r12176
2014-01-11 00:33:31 +00:00
Connor Wakamo
b0f27de6b8 [frontend] Move InputKind from CompilerInvocation to FrontendOptions, and move handling of -parse-as-library to ParseFrontendArgs().
Swift SVN r12174
2014-01-11 00:33:30 +00:00
Connor Wakamo
044be74855 [frontend] Move ParseStdlib from CompilerInvocation to FrontendOptions, and move handling of -parse-stdlib to ParseFrontendArgs().
Swift SVN r12173
2014-01-11 00:33:30 +00:00
Connor Wakamo
a7460947bd [frontend] Made -primary-file accept a value (instead of relying on relative position of arguments).
Also added a -primary-file= alias.

Swift SVN r12171
2014-01-11 00:06:24 +00:00
Connor Wakamo
8c04586911 [frontend] Add support for specifying the primary input with the -primary-file flag.
Swift SVN r12150
2014-01-10 22:39:05 +00:00
Joe Groff
e06ee37dca Enable SIL protocol witnesses.
We should be able to cut out another layer of IRGen grime now.

This does XFAIL one test, test/Prototypes/TextFormatting.swift, which fails because of a weird archetype ordering in a nested substitution list. This should get sorted out by switching to interface types, so I'm going to let it go until then.

Swift SVN r11618
2013-12-24 04:36:03 +00:00
Greg Parker
0e360cb26e Install stdlib into /usr/lib/swift/<OS name>/.
This reinstates r11411 with fixes for the autoconf+make build.


Swift SVN r11494
2013-12-20 01:01:35 +00:00
Argyrios Kyrtzidis
21518ab695 [Frontend] When setting the MainInputFilename in the compiler invocation, check first that the input filenames vector is not empty.
Swift SVN r11484
2013-12-19 22:29:27 +00:00
Connor Wakamo
53a0acad66 [frontend] Added temporary support for setting MainInputFilename, Triple, and OutputFilename in IRGenOptions.
MainInputFilename and OutputFilename are pulled from the FrontendOptions, while Triple is parsed directly from the ArgList.
Eventually, MainInputFilename and OutputFilename should likely be removed from IRGenOptions, in favor of the values in FrontendOptions, while Triple will be in a separate TargetOptions class.

Swift SVN r11455
2013-12-18 23:42:53 +00:00
Connor Wakamo
0f6c51dd5b [frontend] Add support for -enable-dynamic-value-type-layout.
Swift SVN r11454
2013-12-18 23:42:53 +00:00
Connor Wakamo
19c9107fa5 [frontend] Add support for -disable-llvm-optzns.
Swift SVN r11453
2013-12-18 23:42:52 +00:00
Connor Wakamo
8b808311b3 [frontend] Added support for parsing -O.
Swift SVN r11452
2013-12-18 23:42:52 +00:00
Connor Wakamo
39bb2bf2a2 [frontend] Added proper support for parsing -l and -framework.
Moved the responsibility for storing LinkLibraries from CompilerInvocation to the invocation’s IRGenOpts.
Moved the handling of -l and -framework into ParseIRGenArgs.

Swift SVN r11450
2013-12-18 23:42:51 +00:00
Connor Wakamo
90480e9c13 [frontend] Add support for the -g option.
Added a static ParseIRGenArgs function, which includes a handler for -g (including setting up the DWARFDebugFlags appropriately).

Swift SVN r11449
2013-12-18 23:42:50 +00:00
Chris Lattner
073974dca4 revert r11411, which completely broke the makefile build.
Swift SVN r11414
2013-12-18 04:33:58 +00:00
Greg Parker
9032632299 Install stdlib into /usr/lib/swift/<OS name>/.
Swift SVN r11411
2013-12-18 02:19:29 +00:00
Connor Wakamo
7fae046c0e [frontend] Fix indentation issue.
Swift SVN r11402
2013-12-18 00:05:46 +00:00
Connor Wakamo
8ec19ce6e1 [frontend] Fix formatting issue.
Swift SVN r11401
2013-12-17 23:53:18 +00:00
Connor Wakamo
9bbb4fcbdf [frontend] Use "main" as a fallback module name if there's only one input file and it's kind is SourceFileKind::Main.
Swift SVN r11400
2013-12-17 23:36:56 +00:00
Connor Wakamo
129d307bc1 [frontend] Adjusted the handling of -module-name in the integrated frontend to provide fallbacks and diagnostics.
This matches the behavior of the swift executable.

Swift SVN r11394
2013-12-17 21:34:25 +00:00
Connor Wakamo
5a603a3cd1 [driver] Add support for -emit-ir and -emit-bc.
Added driver-level support for generating commands with -emit-ir and -emit-bc as well integrated frontend support for handling -emit-ir and -emit-bc.

Swift SVN r11375
2013-12-17 02:43:40 +00:00
Connor Wakamo
3705f018ac [frontend] Make -dump-parse explicitly set ParseOnly to true.
Also updated the comments in FrontendOptions::ActionType to indicate that only -dump-parse skips type-checking. (Previously, the comments implied that -parse also skipped type-checking, which is not the desired behavior.)

Swift SVN r11374
2013-12-17 02:43:39 +00:00
Connor Wakamo
20e0d1c64e [frontend] Add support for parsing the action which the integrated frontend should perform.
Added an ActionType enum to FrontendOptions with the various actions that the integrated frontend will support, as well as a new RequestedAction member.
Added support for determining the user’s requested action in ParseFrontendArgs. (The integrated frontend does not yet honor this request; support for that is forthcoming.)

Swift SVN r11372
2013-12-17 02:43:27 +00:00