Commit Graph

659 Commits

Author SHA1 Message Date
David Ungar
e9ada4cd0e FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.
-
2017-12-12 16:01:12 -08:00
David Ungar
c1f81867d7 Merge pull request #13268 from davidungar/PR3A-rb
FrontendInputs data structure redo, rebased.
2017-12-11 20:44:10 -08:00
David Ungar
724d1c36cd Last round of small changes 2017-12-11 17:19:06 -08:00
David Ungar
60827b4be3 Rename accessors to InputFile data. 2017-12-08 12:57:32 -08:00
David Ungar
acce229d0a Use llvm::StringSet for PrimaryFiles. 2017-12-06 15:37:54 -08:00
David Ungar
704d7258d1 Rename hasUniqueInput to hasSingleInput. 2017-12-06 15:25:16 -08:00
David Ungar
7176e1fc72 Clarify reading inputs. 2017-12-06 15:22:25 -08:00
Adrian Prantl
97f9e4e367 Don't pass -Werror to ClangImporter's clang when Swift is used from within LLDB.
This works a around search path problems caused by a module existing
in both the build/install directory and the source directory.

<rdar://problem/35714074>
2017-12-06 09:22:29 -08:00
David Ungar
28b206008f FrontendInputs data structure redo.
- Outlaw duplicate input files, fix driver, fix tests, and add test.
- Reflect that no buffer is present without a (possibly pseudo) named file.
- Reflect fact that every input has a (possible pseudo) name.
- Break up CompilerInstance::setup.

Don't bail on dups.
2017-12-05 17:28:03 -08:00
David Ungar
2cda5a91c5 Merge pull request #13233 from davidungar/PR2-5
Preparatory, simple changes to ease reviewing of the next PR.
2017-12-04 19:28:25 -08:00
David Ungar
ab0c44d2b7 Merge pull request #13183 from davidungar/move-in-to-next-imm-out-fix-rb1
Break up ParseFrontendOptions and reorganize module and output files computation, V2.
2017-12-04 19:27:27 -08:00
David Ungar
67fc5e32ce Simple changes to pave the way for the next PR.
- Moved getOutputFilenamesFromCommandLineOrFilelist & readOutputFileLIst to better places in the file.
- Capitalization changes.
- Make actionIsImmediate static.
- Add braces around sections of CompilerInstance::setup to clarify scopes of local variables.
2017-12-03 13:56:06 -08:00
David Ungar
df21c6c266 Taking Jordan's suggestions. 2017-12-01 17:39:08 -08:00
Graydon Hoare
3726e69852 [NamedLazyMemberLoading] Flip flag polarity: on by default, optionally off. 2017-12-01 16:52:25 -08:00
David Ungar
ccb73783dc Bug fixes & module name cleanup.
Unify actionHasOutput w/ doesActionProduceOutput & correct both.
Do not set an output filename if there is no output.
Add test to ensure no output is created in immediate mode.

Restore NFC module name computation.
2017-12-01 12:44:32 -08:00
Arnold Schwaighofer
eba12a7c3e Revert "Finish and default-enable named lazy member loading" 2017-12-01 07:25:54 -08:00
swift-ci
7e6f7e1c04 Merge pull request #12843 from graydon/force-on-named-lazy-member-loading 2017-12-01 02:32:10 -08:00
Graydon Hoare
3de4297c91 [NamedLazyMemberLoading] Flip flag polarity: on by default, optionally off. 2017-11-30 22:01:05 -08:00
David Ungar
6de07d050c Review fixes:
Rename isThereAPrimaryInputWithAFilenameAt to isInputPrimary.
Remove spurious delayed_function_body_parsing.
Simply return type of getOutputFilenamesFromCommandLineOrFilelist.
2017-11-30 17:28:15 -08:00
David Ungar
04c16cdebd Incorperate advice from review.
Change “have” routines to “has”.
Use more consistent casing.
Remove spurious “DelayedFunctionParsing” option.
Move debugFail routines to top lexical level.
Rename and reorder declaration of functions in FrontendArgsToOptionsConverter.
Move, reword, and doxygenate comments for some of those functions.
Fix casing on some more setUp* functions.
Return NoneAction instead of existing RequestedAction in FrontendArgsToOptionsConverter::determineRequestedAction.
Remove test names and put in FIXME’s.
Remove “Jordan” from comments & reword.
Reorder if-then arms of FrontendArgsToOptionsConverter::computeOutputFilenames for readability.
Test for empty string instead of equality with “”.
Use hasUnusedModuleDocOutputPath.
Remove optionality from return type of getOutputFilenamesFromCommandLineOrFilelist.
Rename isPrimaryInputAFileAt to isThereAPrimaryInputWithAFilenameAt.
Added a FIXME in doesActionProduceOutput to reflect that some actions actually do not produce output.
2017-11-30 17:28:15 -08:00
David Ungar
6d2e3f51e7 Break up ParseFrontendOptions and reorganize module and output files computations. 2017-11-30 17:28:14 -08:00
Arnold Schwaighofer
1a0443040e Revert "Merge pull request #12952 from davidungar/move-in-to-next"
This reverts commit 911140c7e1, reversing
changes made to 5590a2ff91.

This broke the incremental bot.

rdar://35746584
2017-11-29 08:09:42 -08:00
swift-ci
cdab55a202 Merge pull request #13124 from DougGregor/se-0143-experimental-flag 2017-11-28 16:59:27 -08:00
David Ungar
911140c7e1 Merge pull request #12952 from davidungar/move-in-to-next
Break up ParseFrontendOptions and reorganize module and output files computations.
2017-11-28 16:58:09 -08:00
Doug Gregor
b59c30c1af [SE-0143] Put conditional conformances behind an "experimental" flag.
Conditional conformances aren't quite ready yet for Swift 4.1, so
introduce the flag `-enable-experimental-conditional-conformances` to
enable conditional conformaces, and an error when one declares a
conditional conformance without specifying the flag.

Add this flag when building the standard library (which will vend
conditional conformances) and to all of the tests that need it.

Fixes rdar://problem/35728337.
2017-11-28 16:01:51 -08:00
David Ungar
d16ae98e2a Review fixes:
Rename isThereAPrimaryInputWithAFilenameAt to isInputPrimary.
Remove spurious delayed_function_body_parsing.
Simply return type of getOutputFilenamesFromCommandLineOrFilelist.
2017-11-28 13:28:10 -08:00
Jordan Rose
4b085d0e75 Remove support for detecting the host OS version on Apple platforms
(originally added in 23f25e1d)

This was only ever used for immediate mode on a Mac, and as the
previous commit shows that's no longer necessary. LLVM has their own
implementation of this and it's the default behavior for
build-for-host now.

Cleanup for rdar://problem/29948658
2017-11-28 11:36:35 -08:00
David Ungar
b4681b154d Incorperate advice from review.
Change “have” routines to “has”.
Use more consistent casing.
Remove spurious “DelayedFunctionParsing” option.
Move debugFail routines to top lexical level.
Rename and reorder declaration of functions in FrontendArgsToOptionsConverter.
Move, reword, and doxygenate comments for some of those functions.
Fix casing on some more setUp* functions.
Return NoneAction instead of existing RequestedAction in FrontendArgsToOptionsConverter::determineRequestedAction.
Remove test names and put in FIXME’s.
Remove “Jordan” from comments & reword.
Reorder if-then arms of FrontendArgsToOptionsConverter::computeOutputFilenames for readability.
Test for empty string instead of equality with “”.
Use hasUnusedModuleDocOutputPath.
Remove optionality from return type of getOutputFilenamesFromCommandLineOrFilelist.
Rename isPrimaryInputAFileAt to isThereAPrimaryInputWithAFilenameAt.
Added a FIXME in doesActionProduceOutput to reflect that some actions actually do not produce output.
2017-11-28 09:21:35 -08:00
David Ungar
b37219f791 Break up ParseFrontendOptions and reorganize module and output files computations. 2017-11-27 20:52:25 -08:00
David Ungar
83ee8cb7f0 Merge pull request #12920 from davidungar/Move-input-conversion
Move input conversion
2017-11-27 17:13:48 -08:00
Arnold Schwaighofer
3e04f21a41 SIL: Remove EnableGuaranteedClosureContext now that it is the default 2017-11-27 07:25:03 -08:00
Michael Gottesman
ba437817db [frontend] Add a new experimental option "enable_guaranteed_normal_arguments" that causes normal parameters to be emitted at +0.
This is for testing purposes. I am not going to thread this further up into the
cmake since I am just going to be triggering this using -extra-swift-args from
build-script.

rdar://34222540
2017-11-19 12:39:34 -08:00
David Ungar
26537ea26c Address Jordan’s comments:
- Also be consistent about has vs have for Input predicates

Fix bug.
2017-11-18 14:00:32 -08:00
Slava Pestov
076d5ee242 Frontend: Remove -delayed-function-body-parsing flag 2017-11-18 11:31:19 -05:00
David Ungar
07dfa263cd Keep separate lists instead of same file twice in one list. 2017-11-17 16:46:49 -08:00
Erik Eckstein
416082ccd5 driver: Make -remove-runtime-asserts a driver option, which is passed to the frontend
rdar://problem/35602951
2017-11-17 13:33:55 -08:00
David Ungar
70ddd3d53b Read command line arguments even if filelist is present. 2017-11-15 11:08:42 -08:00
David Ungar
3f3d784144 Factor code from tools & move input conversion. 2017-11-14 20:48:59 -08:00
David Ungar
1bf1073c4f Remove extra StringRef constructor. 2017-11-14 20:43:57 -08:00
David Ungar
a406d3ae3f Factor common code out of tools into CompilerInvocation::setUpInputForSILTool. 2017-11-14 20:31:53 -08:00
Erik Eckstein
90c21be191 Unify the implementation of optimization mode in various option classes.
This commit is mostly refactoring.

*) Introduce a new OptimizationMode enum and use that in SILOptions and IRGenOptions
*) Allow the optimization mode also be specified for specific SILFunctions. This is not used in this commit yet and thus still a NFC.

Also, fixes a minor bug: we didn’t run mandatory IRGen passes for functions with @_semantics("optimize.sil.never")
2017-11-14 11:25:02 -08:00
David Ungar
45bf920654 Formatted. 2017-11-13 15:03:52 -08:00
David Ungar
495aeeca3f Change enum ActionType to enum class ActionType. 2017-11-13 14:53:18 -08:00
Doug Gregor
5d5e6122f3 [GSB] Add verification of all generic signatures within a module.
Add a verification pass to ensure that all of the generic signatures in
a module are both minimal and canonical. The approach taken is quite
direct: for every (canonical) generic signature in the module, try
removing a single requirement and forming a new generic signature from
the result. If that new generic signature that provide the removed
requirement, then the original signature was not minimal.

Also canonicalize each resulting signature, to ensure that it meets the
requirements for a canonical signature.

Add a test to ensure that all of the generic signatures in the Swift
module are minimal and canonical, since they are ABI.
2017-11-07 15:20:38 -08:00
Arnold Schwaighofer
56a1663c98 Merge pull request #12658 from rajbarik/master
Improve Osize
2017-10-30 07:23:49 -07:00
swift-ci
dfbcccfb75 Merge pull request #12585 from anemet/save-opt-record 2017-10-27 11:09:50 -07:00
Raj Barik
c0b7cf0ff5 Expose UnrollThreshold and Inline_Benefit_reduction in the command line for automatic code size tuning 2017-10-27 10:30:23 -07:00
Adam Nemet
66085a8aef Save optimization remarks in an external YAML file
This brings the capability from clang to save remarks in an external YAML files.
YAML files can be viewed with tools like the opt-viewer.

Saving the remarks is activated with the new option -save-optimization-record.

Similarly to -emit-tbd, I've only added support for single-compile mode for now.
In this case the default filename is determined by
getOutputFilenameFromPathArgOrAsTopLevel, i.e. unless explicitly specified
with -save-optimization-record-path, the file is placed in the directory of the
main output file as <modulename>.opt.yaml.
2017-10-27 10:14:27 -07:00
Graydon Hoare
30b6fdce83 Merge pull request #12429 from graydon/named-lazy-member-loading
Named lazy member loading 1/N
2017-10-24 14:27:04 -07:00
Roman Levenstein
5047e1b475 Enable the serialization of sil_vtables by default and completely remove the -sil-serialize-vtables option
Only sil_vtables of public classes with fixed layout are serialized.
2017-10-21 11:36:12 -07:00