Commit Graph

1433 Commits

Author SHA1 Message Date
Connor Wakamo
23a60d60d8 [frontend] Added support for -delayed-function-body-parsing.
Swift SVN r11188
2013-12-12 17:32:02 +00:00
Connor Wakamo
a4f766e430 [frontend] Add support for -emit-sil-protocol-witness-tables.
Swift SVN r11187
2013-12-12 17:32:01 +00:00
Connor Wakamo
04bdf73b91 [frontend] Move options for controlling the behavior of the Clang importer into a new ClangImporterOptions class.
Added a new ClangImporterOptions class which wraps the ModuleCachePath and ExtraArgs for the Clang importer.
Added a new ParseClangImporterArgs static function which fills in the passed-in ClangImporterOptions.
Updated CompilerInvocation and CompilerInvocation::parseArgs() to use ClangImporterOptions and ParseClangImporterArgs, respectively.

Swift SVN r11180
2013-12-12 03:53:20 +00:00
Connor Wakamo
adbd61d024 [frontend] Added support for -debug-constraints-attempt.
Swift SVN r11174
2013-12-12 03:17:44 +00:00
Connor Wakamo
b4ea0c8b73 [frontend] Added support for the -use-malloc flag.
Added a new static ParseLangArgs, which fills in a LangOptions object.
Also moved the handling of -debug-constraints out of the loop in CompilerInvocation::parseArgs() and into ParseLangArgs, now that it has a proper home.

Swift SVN r11172
2013-12-12 02:44:34 +00:00
Connor Wakamo
4ede1d0c23 [frontend] Added support for parsing the “-emit-verbose-sil” frontend argument.
This is not yet hooked up anywhere (beyond FrontendOptions), since the integrated frontend does not yet know how to emit SIL.

Swift SVN r11161
2013-12-12 00:48:13 +00:00
Connor Wakamo
b434cfe19a Updated comment.
Swift SVN r11158
2013-12-12 00:48:11 +00:00
Connor Wakamo
295b438d23 [frontend] Check for unknown arguments before attempting to handle other arguments.
Moved the check for unknown arguments ahead of any other attempts to handle arguments.
Added test/Frontend/unknown-arguments.swift, which tests the unknown argument handling of "swift_driver -frontend".

Swift SVN r11157
2013-12-12 00:23:35 +00:00
Connor Wakamo
59c07ab012 [frontend] Began splitting options in CompilerInvocation into separate classes.
Added a new FrontendOptions class, which will eventually contain the options for controlling the behavior of the frontend. (This is similar to Clang’s FrontendOptions class.)
Moved InputFilenames, OutputFilename, ModuleName, and SerializedDiagnosticsPath from CompilerInvocation into FrontendOptions.
Split out argument parsing for options in FrontendOptions into a separate ParseFrontendArgs static function.

Swift SVN r11155
2013-12-11 23:58:55 +00:00
Connor Wakamo
93fcbed8b6 [frontend] Switch from a default case to OPT_UNKNOWN for catching unknown arguments.
The integrated frontend already doesn't handle certain arguments which it understands (such as, for the moment, '-c'), so only emit an error in the event of an unknown option, not just unhandled options.

Swift SVN r11110
2013-12-11 01:29:18 +00:00
Connor Wakamo
c6d23228db [frontend] Updated CompilerInvocation::parseArgs() so that it emits a diagnostic when it encounters an unknown argument.
Added a test which ensures that the driver invokes the integrated frontend in a way which does not produce any errors, in order to catch mismatches between the options the driver passes to the integrated frontend and the options which the integrated frontend accepts.

Swift SVN r11105
2013-12-11 00:26:06 +00:00
Connor Wakamo
02c1532d27 Initial support for an integrated frontend in swift_driver.
- Added support for invoking the Swift frontend via "swift_driver -frontend".
- Added frontend_main.cpp, which implements the main entry point for the
  integrated frontend. (Currently, this supports compiling an input Swift file
  into an object file.)
- Removed lib/Frontend/FrontendOptions.td, and replaced its functionality with
  options in include/Swift/Driver/Options.td and a new
  include/Swift/Driver/FrontendOptions.td. Options supported by the frontend
  are denoted by the FrontendOption flag; options which are not supported by
  the driver are denoted by the NoDriverOption flag.
- Updated CompilerInvocation::parseArgs() to use the option table returned from
  createDriverOptTable(), including renaming a handful of options. (-triple is
  now -target, and -Xclang is now -Xcc.)

Swift SVN r11082
2013-12-10 18:06:54 +00:00
Argyrios Kyrtzidis
041a49bb95 [Frontend] Add '-module-name' to FrontendOptions.td.
Swift SVN r10991
2013-12-08 07:39:49 +00:00
Jordan Rose
417b5d3982 Merge TranslationUnit into Module, and eliminate the term "translation unit".
This completes the FileUnit refactoring. A module consists of multiple
FileUnits, which provide decls from various file-like sources. I say
"file-like" because the Builtin module is implemented with a single
BuiltinUnit, and imported Clang modules are just a single FileUnit source
within a module.

Most modules, therefore, contain a single file unit; only the main module
will contain multiple source files (and eventually partial AST files).

The term "translation unit" has been scrubbed from the project. To refer
to the context of declarations outside of any other declarations, use
"top-level" or "module scope". To refer to a .swift file or its DeclContext,
use "source file". To refer to a single unit of compilation, use "module",
since the model is that an entire module will be compiled with a single
driver call. (It will still be possible to compile a single source file
through the direct-to-frontend interface, but only in the context of the
whole module.)

Swift SVN r10837
2013-12-05 01:51:15 +00:00
Argyrios Kyrtzidis
de6cb0bcfe [Frontend] Handle '-module-source-list' in CompilerInvocation::parseArgs.
Swift SVN r10327
2013-11-10 23:49:35 +00:00
Argyrios Kyrtzidis
5a673d2e77 [Frontend] Handle '-serialize-diagnostics' in CompilerInvocation::parseArgs.
Swift SVN r10326
2013-11-10 23:49:34 +00:00
Argyrios Kyrtzidis
ac8d86d2d6 [Frontend] In CompilerInvocation::parseArgs() parse the output filename argument.
Swift SVN r10043
2013-11-08 18:29:39 +00:00
Argyrios Kyrtzidis
5183cec03d [Frontend] In CompilerInvocation::parseArgs() handle the input filenames as well.
Swift SVN r10013
2013-11-07 00:51:54 +00:00
Chris Lattner
68af974227 Remove 'axle' related code and build machinery. It turns out that we
will not be pursuing this project in the immediate future.



Swift SVN r9901
2013-11-03 16:04:27 +00:00
Jordan Rose
f7f253320a Re-add -l flag to Swift interim driver.
This is useful in -i and REPL modes, which do not have a separate linking
step. This version of the -l flag doesn't rely on TranslationUnit. I also
cleaned up the library-loading diagnostics.

Swift SVN r9488
2013-10-18 18:52:10 +00:00
Mon Ping Wang
00467ba953 Reintroduce "Add support for Axle library." from 9292. Added an dependency to prevent building the
core and axle core at the same time.


Swift SVN r9309
2013-10-14 07:51:19 +00:00
Joe Groff
cf457d2210 Revert "Add support for Axle library." It breaks the build.
This reverts commit r9292.

Swift SVN r9296
2013-10-13 22:38:22 +00:00
Mon Ping Wang
41aca3e7e6 Add support for Axle library. Please note that AxeBuiltins.gyb will be
expanded soon for the other graphics builtins.


Swift SVN r9294
2013-10-13 19:54:01 +00:00
Jordan Rose
ad75aa5021 Remove -l flag from Swift interim driver.
Being able to pass -l to the driver isn't so interesting, and it's an
extra field that lives on TranslationUnit for no reason. Just remove it.

This doesn't interfere with autolinking, i.e. inferring -l flags based on
imported modules.

Swift SVN r9241
2013-10-12 00:08:06 +00:00
Argyrios Kyrtzidis
b4f0a4bec0 [Frontend] Introduce "-Xclang" option to pass extra flags to the clang importer.
Swift SVN r9199
2013-10-11 16:28:24 +00:00
Jordan Rose
09787207fc Push TUKind into SourceFile (as InputKind).
Different SourceFiles in the same module will eventually have different
input kinds (at the very least Main vs. Library).

Swift SVN r9076
2013-10-09 18:38:25 +00:00
John Garvin
be87761670 Change name to Axle everywhere.
Swift SVN r8686
2013-09-26 01:24:38 +00:00
John Garvin
4a8ac0d752 Parse kernel, vertex, and fragment function attributes. Metadata is not yet being generated.
This is part of <rdar://problem/14951602> AGP5 bring up: Parse AGP5 kernel function attributes.



Swift SVN r8670
2013-09-25 22:16:57 +00:00
Chris Lattner
dea8213ef9 remove the -enable-definite-init command line option. Definite init
seems to have stuck.


Swift SVN r7956
2013-09-05 20:37:41 +00:00
Jordan Rose
22912bc3b3 Add a -l flag to Swift and use it to provide autolinking information.
The spelling of the flag can certainly be changed; I just wanted to get
something up and running.

Swift SVN r7582
2013-08-26 18:57:48 +00:00
Argyrios Kyrtzidis
ad38cb384b [frontend] Add '-parse-as-library' at the tablegen'ed frontend options.
Swift SVN r7500
2013-08-23 16:46:09 +00:00
Argyrios Kyrtzidis
8c9a7a581f Introduce parsing of frontend options using LLVM's tablegen'ed Options infrastructure.
Implement CompilerInvocation::parseArgs(), which parses a list of arguments and initializes
the CompilerInvocation object.

Swift SVN r7473
2013-08-22 20:21:07 +00:00
Argyrios Kyrtzidis
7b3988f74b [frontend] Put CompilerInvocation implementation into its own file.
Swift SVN r7464
2013-08-22 18:29:54 +00:00