Commit Graph

1350 Commits

Author SHA1 Message Date
swift-ci
05599208ee Merge remote-tracking branch 'origin/master' into master-next 2017-04-17 17:08:32 -07:00
Slava Pestov
497336c4bc IRGen: Use the right reference counting for subclass existentials 2017-04-17 17:22:28 -06:00
Huon Wilson
93dfa5ea97 [IRGen] ObjC class aliases are as visible as their aliasee. 2017-04-17 14:32:50 -07:00
swift-ci
49e3cfb16f Merge remote-tracking branch 'origin/master' into master-next 2017-04-13 23:48:31 -07:00
Slava Pestov
a5a40c7fc7 Runtime/IRGen: Preliminary plumbing for subclass existentials 2017-04-13 21:29:57 -07:00
swift-ci
05aff8998a Merge remote-tracking branch 'origin/master' into master-next 2017-04-13 14:28:31 -07:00
Huon Wilson
22c9e20a9d [IRGen] Completely remove witness table offsets.
These are unused.
2017-04-13 11:44:01 -07:00
swift-ci
d419eee536 Merge remote-tracking branch 'origin/master' into master-next 2017-04-12 10:08:43 -07:00
Arnold Schwaighofer
4d60ec333b AST/SILGen support for constant string literals
rdar://30545013
2017-04-11 11:41:43 -07:00
Joe Groff
85ad6b355e Merge branch 'master' into keypaths 2017-04-06 18:02:07 -07:00
Bob Wilson
c6e37c1f0a Merge remote-tracking branch 'origin/master' into master-next 2017-04-05 17:26:52 -07:00
Huon Wilson
31b92b1b46 Merge pull request #8473 from huonw/symbol-list-2
Remove dependency on IRGenModule of some linkage computations
2017-04-05 16:39:04 -07:00
Huon Wilson
3105c6ed00 [IRGen] Expose LinkInfo publicly, like LinkEntity. 2017-04-05 09:54:19 -07:00
Huon Wilson
19301e984f [IRGen] Remove unnecessary IRGenModule arguments. 2017-04-05 09:54:19 -07:00
Joe Groff
d42f2049f7 KeyPaths: Implement in-place instantiation of invariant key paths.
For key paths without generic or subscript parameterization, we can turn the compiler-generated key path pattern into a global object in-place.
2017-04-05 08:46:45 -07:00
swift-ci
c45695815b Merge remote-tracking branch 'origin/master' into master-next 2017-04-03 23:48:33 -07:00
Slava Pestov
37491e63ac AST: Refactor existential type accessors on TypeBase and CanType 2017-04-03 23:14:25 -07:00
swift-ci
77256de568 Merge remote-tracking branch 'origin/master' into master-next 2017-03-24 02:28:44 -07:00
Slava Pestov
7aabd80898 SIL: Stub out TypeConverter::getOverriddenVTableEntry()
This replaces SILDeclRef::getBaseOverriddenVTableEntry(). It lives
in the TypeConverter because it needs to use type lowering information
to determine if the method requires a new vtable entry or not.
2017-03-24 01:53:39 -07:00
swift-ci
eea67b3d8c Merge remote-tracking branch 'origin/master' into master-next 2017-03-23 20:08:44 -07:00
Slava Pestov
b42675c235 IRGen: Use SILVTableVisitor instead of bespoke member traversal 2017-03-23 18:17:42 -07:00
Saleem Abdulrasool
15565c116a Adjust for SVN r298393 2017-03-22 07:44:03 -07:00
Erik Eckstein
1625345b90 Remove the old mangler.
NFC
2017-03-17 16:10:36 -07:00
John McCall
720481d2f6 IRGen's archetype access path hack is now dead code, RIP. NFC. 2017-03-14 22:00:27 -04:00
John McCall
897f5ab7c5 Restore CanType-based micro-optimizations.
This reverts commit 5036806e5a.
However, it preserves a pair of changes to the SIL optimizer
relating to walking through optional types.
2017-03-14 11:38:11 -04:00
Slava Pestov
5036806e5a AST: Remove some unnecessary getCanonicalType() calls 2017-03-13 02:24:36 -07:00
Erik Eckstein
41c17a5b0c IRGen: emit type metadata and (value) witness tables lazily.
This gives big code size wins for unused types and also for types, which are never used in a generic context.
Also it reduces the amount of symbols in the symbol table.
The size wins heavily depend on the project. I have seen binary size reductions from 0 to 20% on real world projects.

rdar://problem/30119960
2017-03-10 12:50:43 -08:00
John McCall
d61d966451 Use ConstantInitBuilder in most kinds of metadata emission.
This is NFC in intent, but I had to restructure the code to emit more
of the lists "inline", which means I inevitably altered some IRGen
emission patterns in ways that are visible to tests:

- GenClass emits property/ivar/whatever descriptors in a somewhat
  different order.

- An ext method type list is now emitted as just an array, not a struct
  containing only that array.

- Protocol descriptors are no longer emitted as packed structs.

I was sorely tempted to stop using packed structs for all the metadata
emission, but didn't really want to update that many tests in one go.
2017-03-06 14:18:47 -05:00
Erik Eckstein
d4b256cd8f Use new mangling for protocol names in protocol descriptors 2017-02-22 16:00:20 -08:00
Doug Gregor
042e6510c3 [AST] Drop ProtocolDecl's "inherited protocols" list.
The list of directly inherited protocols of a ProtocolDecl is already
encoded in the requirement signature, as conformance constraints where
the subject is Self. Gather the list from there rather than separately
computing/storing the list of "inherited protocols".
2017-02-20 09:41:00 -08:00
Erik Eckstein
2d127e4192 Reinstate ”Use the new mangling for reflection."
It also uses the new mangling for type names in meta-data (except for top-level non-generic classes).
lldb has now support for new mangled metadata type names.

This reinstates commit 21ba292943.
2017-02-15 09:47:22 -08:00
Slava Pestov
5296d02485 AST: More include-what-you-use gardening 2017-02-12 00:51:26 -08:00
Doug Gregor
aa42045d66 [AST] “Error” types aren’t really unchecked; deal with them explicitly. 2017-02-11 00:04:13 -08:00
Erik Eckstein
254f36aba5 Revert "Use the new mangling for reflection."
This needs some changes in lldb.
Disabled for now until lldb supports the new mangling.

This reverts commit 21ba292943.
2017-02-08 09:01:51 -08:00
David Farler
1b141d368e Fix two more duplicate case llvm::Triple::Wasm 2017-02-07 17:20:00 -08:00
Hugh Bellamy
86d204c6fe Merge pull request #7052 from hughbe/object-model
Fix warnings for llvm::Triple::Wasm after updating LLVM to upstream
2017-02-08 08:01:55 +07:00
Erik Eckstein
21ba292943 Use the new mangling for reflection.
For this we are linking the new re-mangler instead of the old one into the swift runtime library.
Also we are linking the new de-mangling into the swift runtime library.

It also switches to the new mangling for class names of generic swift classes in the metadata.
Note that for non-generic class we still have to use the old mangling, because the ObjC runtime in the OS depends on it (it de-mangles the class names).
But names of generic classes are not handled by the ObjC runtime anyway, so there should be no problem to change the mangling for those.
The reason for this change is that it avoids linking the old re-mangler into the runtime library.
2017-02-07 08:36:21 -08:00
Slava Pestov
36433f126e IRGen: Fix some non-exhaustive switch warnings 2017-02-06 22:39:26 -08:00
Slava Pestov
c90a77df31 IRGen: Use SubstitutionMap instead of ArrayRef<Substitution> in a few places
The crazy indexing logic is gone.
2017-02-03 19:55:41 -08:00
Roman Levenstein
5a4d82716d Merge pull request #7112 from swiftix/wip-irgen-fixes
Fix a couple of places in the IRGen where we still don't use interface types
2017-01-30 17:24:32 -08:00
Slava Pestov
dca292c652 Serialization: Don't serialize contextual enum argument type
Storing this separately is unnecessary since we already
serialize the enum element's interface type. Also, this
eliminates one of the few remaining cases where we serialize
archetypes during AST serialization.
2017-01-30 00:08:53 -08:00
Roman Levenstein
383dc9c1e6 Fix a couple of places in the IRGen where we still don't use interface types 2017-01-27 16:38:07 -08:00
Hugh Bellamy
35eaf68461 Fix warnings for llvm::Triple::Wasm after updating LLVM to upstream
> warning C4062: enumerator 'llvm::Triple::Wasm' in switch of enum
'llvm::Triple::ObjectFormatType' is not handled
2017-01-26 10:12:23 +00:00
Han Sangjin
b8dd577693 [swiftc] Fixed for Cygwin
Fixed for the difference of Cygwin with other Windows variants (MSVC,
Itanium, MinGW).

- The platform name is renamed to "cygwin" from "windows" which is used
  for searching the standard libraries.

- The consideration for DLL storage class (DllExport/DllImport) is not
  required for Cygwin and MinGW. There is no problem when linking in
  these environment.

- Cygwin should use large memory model as default.(This may be changed
  if someone ports to 32bit)

- Cygwin and MinGW should use the autolink feature in the sameway of
  Linux due to the linker's limit.
2017-01-19 05:48:24 +09:00
practicalswift
6d1ae2a39c [gardening] 2016 → 2017 2017-01-06 16:41:22 +01:00
Slava Pestov
2082129516 IRGen: Teach emitValueWitnessTableRefForLayout() to handle Optionals
There was a regression from Swift 3 here, we didn't correctly handle
the fact that optional payloads are now lowered, and so IRGen would
crash if an optional payload consisted of a tuple with both a
generic parameter and a function type.

Fixes <https://bugs.swift.org/browse/SR-3548>.
2017-01-04 21:31:09 -08:00
Slava Pestov
064fda52d2 AST: Remove Type::getCanonicalTypeOrNull()
Not sure why but this was another "toxic utility method".
Most of the usages fell into one of three categories:

- The base value was always non-null, so we could just call
  getCanonicalType() instead, making intent more explicit

- The result was being compared for equality, so we could
  skip canonicalization and call isEqual() instead, removing
  some boilerplate

- Utterly insane code that made no sense

There were only a couple of legitimate uses, and even there
open-coding the conditional null check made the code clearer.

Also while I'm at it, make the SIL open archetypes tracker
more typesafe by passing around ArchetypeType * instead of
Type and CanType.
2017-01-04 01:08:29 -08:00
Slava Pestov
fb0f372e94 AST: Move mapType{In,OutOf}Context() out of ArchetypeBuilder and clean up headers
- The DeclContext versions of these methods have equivalents
  on the DeclContext class; use them instead.

- The GenericEnvironment versions of these methods are now
  static methods on the GenericEnvironment class. Note that
  these are not made redundant by the instance methods on
  GenericEnvironment, since the static methods can also be
  called with a null GenericEnvironment, in which case they
  just assert that the type is fully concrete.

- Remove some unnecessary #includes of ArchetypeBuilder.h
  and GenericEnvironment.h. Now changes to these files
  result in a lot less recompilation.
2016-12-18 19:55:41 -08:00
practicalswift
38be6125e5 [gardening] C++ gardening: Terminate namespaces, fix argument names, ...
Changes:
* Terminate all namespaces with the correct closing comment.
* Make sure argument names in comments match the corresponding parameter name.
* Remove redundant get() calls on smart pointers.
* Prefer using "override" or "final" instead of "virtual". Remove "virtual" where appropriate.
2016-12-17 00:32:42 +01:00
Doug Gregor
0228c0c790 Minor cleanups to address @slava_pestov's feedback 2016-12-07 21:54:20 -08:00