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
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
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
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
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