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
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
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
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
These are not yet used, since the integrated frontend doesn’t yet support immediate mode, but they are ready for use once immediate mode is supported.
Swift SVN r11326
Added PrintHelp and PrintHelpHidden to FrontendOptions.
Marked both -help and --help-hidden with the FrontendOption flag.
Updated ParseFrontendArgs to parse -help and --help-hidden.
Updated frontend_main() so that it prints the help for the frontend options.
Swift SVN r11320
Added a new DiagnosticOptions class to swiftBasic, and added a DiagnosticOptions member to CompilerInvocation.
Added a static ParseDiagnosticArgs function to parse diagnostic-related arguments.
Added -verify to FrontendOptions.td, and added support for parsing -verify in ParseDiagnosticArgs.
Updated frontend_main() to enable and trigger the DiagnosticVerifier when -verify is passed.
Swift SVN r11318
Removed CompilerInvocation::TargetTriple and replaced it with CompilerInvocation::TargetOpts, a TargetOptions object.
Added a static ParseTargetArgs function to set up TargetOptions, and moved handling of -target into that function.
Swift SVN r11288
StringRef::getAsInteger returns true, not false, when an error occurs.
Explicitly set the radix to 10, instead of inferring the radix.
For the invalid argument value diagnostic, switch the order of the argument string and the value.
Swift SVN r11279
Also updated findModule() in SourceLoader.cpp and SerializedModuleLoader.cpp to get the ImportSearchPaths from the ASTContext’s SearchPathOpts, instead of directly from the ASTContext.
Swift SVN r11214
Added a new SearchPathOptions class to swiftAST, which will contain options like import search paths and the SDK path.
Moved the RuntimeIncludePath from CompilerInvocation into SearchPathOptions. For now, at least, the RuntimeIncludePath is handled separately from other ImportSearchPaths, since we can’t yet guarantee that RuntimeIncludePath is set up before we parse the ImportSearchPaths.
Added a SearchPathOptions member to ASTContext.
Updated findModule() in SourceLoader.cpp and SerializedModuleLoader.cpp to check RuntimeIncludePath after everything else if no module was found. (This matches existing behavior, which had RuntimeIncludedPath at the end of ImportSearchPaths.)
Swift SVN r11213
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
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
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
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
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
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
- 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
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
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
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