Commit Graph

141 Commits

Author SHA1 Message Date
Doug Gregor
936a701b15 [AST] Stop uniquing canonical GSBs based on the module.
Now that the GenericSignatureBuilder is no longer sensitive to the input
module, stop uniquing the canonical GSBs based on that module. The main
win here is when deserializing a generic environment: we would end up 
creating a canonical GSB in the module we deserialized and another
canonical GSB in the module in which it is used.
2017-10-10 09:41:23 -07:00
Slava Pestov
e806b6248d SIL: Remove dynamic_method instruction 2017-10-04 03:53:16 -07:00
Slava Pestov
7bf3b90b62 SIL: Split off objc_method / objc_super_method from class_method / super_method
This replaces the '[volatile]' flag. Now, class_method and
super_method are only used for vtable dispatch.

The witness_method instruction is still overloaded for use
with both ObjC protocol requirements and Swift protocol
requirements; the next step is to make it only mean the
latter, also using objc_method for ObjC protocol calls.
2017-10-03 22:13:31 -07:00
Joe Shajrawi
610aa582ce Fixes (another) IRGen compiler crash caused by the new large types ABI 2017-10-03 16:16:34 -07:00
John McCall
ab3f77baf2 Make SILInstruction no longer a subclass of ValueBase and
introduce a common superclass, SILNode.

This is in preparation for allowing instructions to have multiple
results.  It is also a somewhat more elegant representation for
instructions that have zero results.  Instructions that are known
to have exactly one result inherit from a class, SingleValueInstruction,
that subclasses both ValueBase and SILInstruction.  Some care must be
taken when working with SILNode pointers and testing for equality;
please see the comment on SILNode for more information.

A number of SIL passes needed to be updated in order to handle this
new distinction between SIL values and SIL instructions.

Note that the SIL parser is now stricter about not trying to assign
a result value from an instruction (like 'return' or 'strong_retain')
that does not produce any.
2017-09-25 02:06:26 -04:00
Joe Shajrawi
980e310119 Fixes a IRGen compiler crash caused by the new large types ABI 2017-08-31 17:21:07 -07:00
Joe Shajrawi
678f495664 Large loadable types: add support for destroy_value -> destroy_addr 2017-08-17 11:30:53 -07:00
Joe Shajrawi
84994dc786 Enable large loadable types by default 2017-08-03 11:45:28 -07:00
Joe Shajrawi
39014b2413 Large Types IRGen Pass: Support new ABI for block-storage calls and types 2017-07-27 18:22:41 -07:00
Joe Shajrawi
932e228e0a Large loadable types: add support for thin_function_to_pointer instructions 2017-07-27 14:35:04 -07:00
Joe Shajrawi
49ffa199da Large Types bugfix: support a corner case for try_apply's that return a large loadable type 2017-07-27 11:31:29 -07:00
Joe Shajrawi
95c188d715 Support indirectly returning large loadable types for type-parmater returns 2017-07-26 18:02:00 -07:00
Joe Shajrawi
32f6bab812 Remove subsumed CFunctionPointer/ObjCMethod/Block in large loadable types 2017-07-26 12:56:01 -07:00
Joe Shajrawi
ddce591dad Large Loadable Types: convention block functions / instructions should use the old ABI 2017-07-26 11:04:15 -07:00
Joe Shajrawi
f96936368c Large Loadable Types: Ignore debug instructions when re-creating function_ref instructions 2017-07-25 18:54:00 -07:00
Joe Shajrawi
34ae83e6f3 Add support for the latest large types test case when parsed as a library: handling builtin instructions. 2017-07-25 15:47:41 -07:00
Joe Shajrawi
faa51cbb64 Support calling functions that contain a large type as the return value from inside functions that maintain the old calling conventions 2017-07-25 14:30:53 -07:00
Joe Shajrawi
f0243c6f70 Resolves an issue with tuple returns for large loadable types + workaround a watch-target test failure 2017-07-25 11:36:31 -07:00
Joe Shajrawi
8faa45c3f5 Large Types IRGen Pass: bugfix for large-type returns 2017-07-24 15:31:04 -07:00
Joe Shajrawi
94935b5f78 Large Types IRGen Pass: return large types as @out 2017-07-17 15:36:51 -07:00
Joe Shajrawi
4823314b7b Large Types IRGen Pass: add support for transforming return of large types into indirect returns 2017-07-05 16:19:01 -07:00
Joe Shajrawi
326ba1e67f Large Types IRGen Pass: Fix runtime crash for large enums 2017-06-23 15:24:20 -07:00
practicalswift
ba5f81888b [gardening] Remove unused variables 2017-05-13 15:48:27 +02:00
Doug Gregor
35c67f6acf Eliminate an unnecessary use of ASTContext::getOrCreateCanonicalGenericEnvironment().
GenericSignature::createGenericEnvironment() is a better API for this.
2017-05-11 16:34:39 -07:00
Roman Levenstein
6402d3d97d Remove even more dead code 2017-05-10 09:11:43 -07:00
Roman Levenstein
f909858f53 Remove dead code that became obsolete after re-factoring 2017-05-10 08:04:28 -07:00
Roman Levenstein
45c2c4af0e Re-factoring: Get rid of useless arguments in "create*Apply" functions
Till now createApply, createTryApply, createPartialApply were taking some arguments like SubstCalleeType or ResultType. But these arguments are redundant and can be easily derived from other arguments of these functions. There is no need to put the burden of their computation on the clients of these APIs.

The removal of these redundant parameters simplifies the APIs and reduces the possibility of providing mismatched types by clients, which often happened in the past.
2017-05-10 08:03:37 -07:00
practicalswift
8c40c65c80 [gardening] Fix typos. 2017-05-09 21:50:04 +02:00
Joe Shajrawi
197a6ce2a9 Merge pull request #9393 from shajrawi/arg_param_mismatch
Large loadable types: support optional inout function arguments
2017-05-08 12:45:09 -07:00
Joe Shajrawi
af6020ff7f Large loadable types: support optional inout function arguments 2017-05-08 11:38:17 -07:00
Joe Shajrawi
748efafd89 Merge pull request #9352 from shajrawi/fix_class_large_types
Resolves an issue with large loadable types wherein functions types inside classes misbehaved
2017-05-05 15:23:07 -07:00
Joe Shajrawi
e334da4efe Resolves an issue with large loadable types wherein functions types inside classes misbehaved 2017-05-05 14:29:41 -07:00
Michael Gottesman
86620aaa7e Merge pull request #9318 from practicalswift/redundant-types-in-casts
[gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
2017-05-05 13:37:12 -07:00
practicalswift
492f5cd35a [gardening] Remove redundant repetition of type names (DRY): RepeatedTypeName foo = dyn_cast<RepeatedTypeName>(bar)
Replace `NameOfType foo = dyn_cast<NameOfType>(bar)` with DRY version `auto foo = dyn_cast<NameOfType>(bar)`.

The DRY auto version is by far the dominant form already used in the repo, so this PR merely brings the exceptional cases (redundant repetition form) in line with the dominant form (auto form).

See the [C++ Core Guidelines](https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#es11-use-auto-to-avoid-redundant-repetition-of-type-names) for a general discussion on why to use `auto` to avoid redundant repetition of type names.
2017-05-05 09:45:53 +02:00
Joe Shajrawi
018e79716f Large loadable types pass: resolves a case wherein a tuple’s extracted type is a function signature 2017-05-04 16:54:33 -07:00
Joe Shajrawi
746fd2841a Fixes a bug in large loadable types wherein only the callee type of Apply is changed 2017-05-04 13:05:09 -07:00
practicalswift
3aff1f9d9f [gardening] Replace dyn_cast<X>(y) with isa<X>(y) where appropriate 2017-05-04 15:24:02 +02:00
Joe Shajrawi
91911991cf Large loadable types: Fixes a bug wherein we did not update an Apply’s result type in case it is a function type 2017-05-03 15:17:40 -07:00
Joe Shajrawi
4fe3a46265 Fix an issue that was uncovered by the linux fix: resolves verifier bug in 32-bit code 2017-05-01 18:41:21 -07:00
Joe Shajrawi
33db65db2e Fix runtime failure on Linux due to large values by address pass 2017-05-01 16:28:03 -07:00
Joe Shajrawi
4dc0801785 IRGen Mandatory Module Pass: Pass large loadable types by address instead of by value 2017-05-01 12:04:06 -07:00