Commit Graph

17 Commits

Author SHA1 Message Date
Slava Pestov
5680bfde55 IRGen: Always use YAML files for completely fragile class layout
The layouts of resilient value types shipped in the Swift 5 standard library
x and overlays will forever be frozen in time for backward deployment to old
Objective-C runtimes. This PR ensures that even if the layouts of these types
evolve in the future, binaries built to run on the old runtime will continue
to lay out class instances in a manner compatible with Swift 5.

Fixes <rdar://problem/45646886>.
2019-02-08 14:22:00 -05:00
Arnold Schwaighofer
3982bdee90 IRGen: Don't emit capture descriptor for stack allocated closures 2019-01-24 13:48:20 -08:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Arnold Schwaighofer
cc7f207cec Rename swift sections from swift4 to swift5
rdar://38465220
2018-05-23 12:18:08 -07:00
Arnold Schwaighofer
0c11e1a0a3 Mark swift sections as swift4 for Swift 4.2
rdar://36363251
2018-03-14 10:27:28 -07:00
Joe Groff
953dddd5d3 IRGen/Runtime: Allow mangled type refs to embed "symbolic references" to type context descriptors.
This makes resolving mangled names to nominal types in the same module more efficient, and for eventual secrecy improvements, also allows types in the same module to be referenced from mangled typerefs without encoding any source-level name information about them.
2018-02-10 10:43:47 -08:00
Arnold Schwaighofer
17cd95efa4 Rename swift3 section and global names to swift5
Such that old and new runtimes can co-exists
rdar://36363251
2018-01-22 10:04:46 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Saleem Abdulrasool
899103cfa8 COFF: restructure metadata registration
Restructure the COFF metadata handling to use the linker section
grouping to emit section start/stop markers in the appropriate location.
This allows us to lookup the sections statically without having to the
walk the entire image structure.

Introduce a constructor for PE/COFF binaries.  This will ensure that the
registration occurs for all modules appropriately.  This should resolve
rdar://problem/19045112.  The registration should occur prior to
`DllMain` being invoked from `DllMainCRTStartup`.
2017-12-08 16:15:07 -08:00
Erik Eckstein
2a55b26e46 Mangling: enable new mangling for symbols 2017-03-16 12:04:08 -07:00
Slava Pestov
7dbab3cc32 IRGen: Clean up reflection metadata emission
There was some duplication here, and also a potential
memory management issue; it appears that we were
converting a temporary std::string to a StringRef
when setting the section name of a global.
2016-09-24 02:17:45 -07:00
Slava Pestov
47d7cacb98 IRGen: Fix emission of builtin reflection descriptors in multi-threaded mode
Ensure they get emitted at the end of the job by the dispatcher, and
also use a proper mangling and shared linkage for these symbols so
that if multiple threads emit the same descriptor it gets merged.

The new tests attempt to exercise these scenarios.

Fixes <rdar://problem/27906876>.
2016-09-12 19:44:53 -07:00
Erik Eckstein
959e19d7bc Add an optimization to eliminate a partial_apply if all applied arguments are dead in the applied function.
This consists of 3 parts:
1) Extend CallerAnalysis to also provide information if a function is partially applied
2) A new DeadArgSignatureOpt pass, similar to FunctionSignatureOpts, which just specializes for dead arguments of partially applied functions.
3) Let CapturePropagation eliminate such partial_apply instructions and replace them with a thin_to_thick conversion of the specialized functions.

This optimzation improves benchmarks where static struct or class functions are passed as a closure (e.g. -20% for SortStrings).
Such functions have a additional metatype parameter. We used to create a partial_apply in this case, which allocates a context, etc.
But this is not necessary as the metatype parameter is not used in most cases.

rdar://problem/27513085
2016-08-23 07:32:41 -07:00
Dmitri Gribenko
d175b3b66d Migrate FileCheck to %FileCheck in tests 2016-08-10 23:52:02 -07:00
John McCall
c8c41b385c Implement SE-0077: precedence group declarations.
What I've implemented here deviates from the current proposal text
in the following ways:

- I had to introduce a FunctionArrowPrecedence to capture the parsing
  of -> in expression contexts.

- I found it convenient to continue to model the assignment property
  explicitly.

- The comparison and casting operators have historically been
  non-associative; I have chosen to preserve that, since I don't
  think this proposal intended to change it.

- This uses the precedence group names and higherThan/lowerThan
  as agreed in discussion.
2016-07-26 14:04:57 -07:00
Michael Gottesman
0e11d47cdb [build-script] When smoke testing on macOS, only build the X86 LLVM code generator
We have no need for the other LLVM code generators (after all the main principle
of this smoke test is to only text X86 on macOS).

To implement this I had to split a couple of IRGen tests that involved multiple
code generator into multiple tests so I could use different REQUIRES lines. This
would be a nice feature to add to lit.
2016-07-21 11:12:56 -07:00
Saleem Abdulrasool
83b2b5994a IRGen: support reflection for swift 3 on COFF
COFF has restrictions on portable section length (8 characters).  Use a FourCC
identifier for the section on COFF.  Take the opportunity to replace a
std::string parameter with a StringRef.
2016-06-02 23:23:42 -07:00