Commit Graph

2276 Commits

Author SHA1 Message Date
swift-ci
fc7b986bab Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 12:09:06 -08:00
Slava Pestov
476e41a4fc Merge pull request #13530 from slavapestov/class-resilience-part-7
Class resilience part 7
2017-12-19 11:51:52 -08:00
swift-ci
18fea54dd3 Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 11:29:13 -08:00
swift-ci
adf83617ec Merge pull request #13526 from DougGregor/remove-conditional-conformances-flag 2017-12-19 11:17:44 -08:00
swift-ci
4a31d01a00 Merge remote-tracking branch 'origin/master' into master-next 2017-12-19 11:09:52 -08:00
Pavel Yaskevich
d3cd61d8eb Merge pull request #13291 from xedin/rdar-34920390
[Mangling/ABI] Mangle function names with parameter labels
2017-12-19 10:50:18 -08:00
Slava Pestov
76499a3ce3 IRGen: Emit immediate class member offset global variable
Not used to access metadata members just yet.
2017-12-19 02:58:35 -07:00
swift-ci
07902f91aa Merge remote-tracking branch 'origin/master' into master-next 2017-12-18 23:09:18 -08:00
Doug Gregor
ffb0d55b35 Eliminate extraneous uses of -enable-experimental-conditional-conformances 2017-12-18 22:56:22 -08:00
Doug Gregor
5c831a71ee Revert "[SE-0143] Put conditional conformances behind an "experimental" flag."
This reverts commit b59c30c1af.
2017-12-18 22:54:31 -08:00
John McCall
1f3f33e67d Clean up the internal APIs around dynamic allocas to structurally
discourage accidental use of them.  Relatedly, fix several bugs
where we were accidentally using dynamic allocas.
2017-12-19 00:29:43 -05:00
Pavel Yaskevich
c18edfc632 [Mangling/ABI] NFC: Fix test failures uncovered by CI on i386 (IRGen/stdlib/DebugInfo) 2017-12-18 21:06:54 -08:00
Pavel Yaskevich
0133827e55 [Mangling/ABI] NFC: Fix IRGen tests to reflect label mangling changes 2017-12-18 15:45:50 -08:00
swift-ci
0302515cf0 Merge remote-tracking branch 'origin/master' into master-next 2017-12-18 12:48:55 -08:00
John McCall
59e2ab4277 The callback to Builtin.once is a C function, not a Swift one.
If we want it to be a Swift function, we'll have to thunk in the
runtime when using a system implementaton like dispatch_once_f,
since the function pointer ABIs could be different, depending on
the target.  Dealing with that, or avoiding it on a per-target basis,
is more complexiity than a micro-optimization of the slow path of
this builtin could possibly be worth.
2017-12-16 02:22:13 -05:00
swift-ci
c0568c925d Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 13:49:34 -08:00
Arnold Schwaighofer
066a627ca0 Reapply "IRGen: The partial application forwarder needs to cast { swift.refcounted* } to swift.refcounted* for AnyObject types on linux"
With fix and test case for failed case.

This reverts commit d14cd40916.

SR-6547
rdar://problem/35911150
2017-12-14 06:41:30 -08:00
swift-ci
535b79c53c Merge remote-tracking branch 'origin/master' into master-next 2017-12-14 04:09:33 -08:00
Arnold Schwaighofer
101ab74269 Merge pull request #13427 from apple/revert-13416-fix_anyobject_closure_linux
Revert "IRGen: The partial application forwarder needs to cast { swift.refcounted* } to swift.refcounted* for AnyObject types on linux"
2017-12-14 04:01:07 -08:00
swift-ci
2f62fadb66 Merge remote-tracking branch 'origin/master' into master-next 2017-12-13 23:09:39 -08:00
Doug Gregor
b3b86d7a25 Merge pull request #13424 from DougGregor/canonicalize-conformance-access-path
[GSB] Canonicalize conformance access paths on-the-fly.
2017-12-13 22:57:02 -08:00
Doug Gregor
d14cd40916 Revert "IRGen: The partial application forwarder needs to cast { swift.refcounted* } to swift.refcounted* for AnyObject types on linux" 2017-12-13 22:49:13 -08:00
Doug Gregor
a77dec1714 [GSB] Canonicalize conformance access paths on-the-fly.
When forming a conformance access path, remove from consideration any
requirement sources that contain protocol requirements that aren't
found in the requirement signature. This ensure well-formedness of the
resulting conformance access path. Huge thanks to Slava for reducing
this one, and apologies to Arnold for having to track it down a second
time before I fixed it.

Fixes SR-6200 / rdar://problem/35113583.
2017-12-13 19:49:15 -08:00
swift-ci
4aec05ae9b Merge remote-tracking branch 'origin/master' into master-next 2017-12-13 18:29:36 -08:00
Arnold Schwaighofer
8610670d0e IRGen: The partial application forwarder needs to cast { swift.refcounted* } to swift.refcounted* for AnyObject types on linux
SR-6547
2017-12-13 14:31:44 -08:00
swift-ci
dd694cb1ca Merge remote-tracking branch 'origin/master' into master-next 2017-12-11 20:49:53 -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
swift-ci
b842db42d7 Merge remote-tracking branch 'origin/master' into master-next 2017-12-11 19:29:43 -08:00
Erik Eckstein
48d49a4cc2 Fix the IR attributes of swift_getObjectType.
It's not readnone, because it reads the metatype from an object.
Readnone would let the llvm ARC optimizer reschedule the call with a release-call for the object.

fixes SR-6560.
2017-12-11 18:16:46 -08:00
swift-ci
1270d9d356 Merge remote-tracking branch 'origin/master' into master-next 2017-12-09 14:49:49 -08:00
swift-ci
a93717988c Merge pull request #13211 from compnerd/COFF-registration 2017-12-09 14:41:41 -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
swift-ci
79a758cf10 Merge remote-tracking branch 'origin/master' into master-next 2017-12-08 15:48:53 -08:00
swift-ci
d1e377b947 Merge remote-tracking branch 'origin/master' into master-next 2017-12-08 14:08:50 -08:00
swift-ci
2935d66e9d Merge remote-tracking branch 'origin/master' into master-next 2017-12-08 14:01:42 -08:00
Slava Pestov
ffabf60118 IRGen: Hollow out generic class templates
Don't emit placeholders for field offsets and vtable entries,
since they were always null. Instead, calculate the final size
of class metadata at runtime using the size of the superclass
metadata and the number of immediate members, and only copy
this prefix from the template to the instantiated metadata,
zero-filling the rest.

For this to work with non-generic resilient classes and
non-generic subclasses of generic classes, we need a new
runtime entry point to relocate non-generic class metadata,
calculating its size at runtime using the same strategy.
2017-12-08 13:50:56 -08:00
Thomas Roughton
c5bf2ec553 [runtime] Remove TwoWordPair and use the Swift calling convention instead. (#13299) 2017-12-07 19:27:24 -08:00
Slava Pestov
0fa7440e51 IRGen/Runtime: Remove old class metadata relocation mechanism 2017-12-07 14:21:58 -08:00
Bob Wilson
487f9decd4 Add some comments to test/IRGen/builtin_math.swift
This test calls sqrt for both Double and Float values, and those calls get
compiled very differently. Add an explanation of the difference.
2017-12-07 12:50:48 -08:00
Bob Wilson
1946d9dc9a master-next: update builtin_math test to work after Clang r319593
This test used to check that sqrt() did not use the LLVM intrinsic because
its behavior did not match IEEE 754 for negative inputs. That has now
changed in recent versions of LLVM. There are still some differences in
how the LLVM intrinsic handles errno, but that should not affect Swift.
With Clang r319593, the test began to fail because __builtin_sqrtf gets
translated to the LLVM intrinsic. Change the test to match.
2017-12-07 12:36:12 -08:00
Slava Pestov
6667ad314c Update tests for Linux 2017-12-05 21:33:35 -08:00
Slava Pestov
df780c05c1 IRGen: Move field type vector slot to appear before the address point 2017-12-05 21:33:35 -08:00
Slava Pestov
ed97617590 IRGen: Move generic class dependent data to appear before the address point 2017-12-05 21:33:35 -08:00
Slava Pestov
6cc4c1fab4 IRGen: Split up class metadata emission into fixed and resilient cases 2017-12-05 21:33:34 -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
Doug Gregor
4f8edeb913 [Runtime] Always fail to find a conditional conformance at runtime.
Proper evaluation of conditional conformances at runtime (e.g., as part of
dynamic casting) is too large to tackle in the Swift 4.1 timeframe. For now,
record that a conformance is conditional in the protocol conformance record,
and always return "does not conform" to such types.

Fixes rdar://problem/35761301.
2017-12-04 16:51:52 -08:00
Arnold Schwaighofer
dfa4b77839 Attempt to fix test/IRGen/objc-sections.swift
Fails on incremental bot
2017-12-03 18:08:18 -08:00
Saleem Abdulrasool
d8552ceb9e IRGen: ensure that ObjC sections match on all targets
Adjust the IRGen for ObjC interop to ensure that the section that
metadata is emitted into the correct section for non-MachO targets.

This also adds a more comprehensive test for ensuring that the IRGen can
now be tested on all targets.  Since the ObjC interop is now
controllable via the driver, this test does not require that the
objc_interop feature is present as it is a IRGen test.

This is the first step to remove the `REQUIRES: objc_interop` from the
IRGen tests.
2017-12-03 15:55:44 -08:00
Joe Groff
fb2fc93cbf IRGen: Followup fixes for handling subclasses of mixed-mode classes with missing ivars.
Following up on the fixes for rdar://problem/35330067. If a class inherits a class from another module with missing fields, we need to treat its size and alignment as opaque, just like the base class itself. We also need to lay out such  class at runtime, since we don't know the size, alignment, or field offsets at compile time; relying on the ObjC runtime alone will slide the ivar offsets, but not the Swift instance size and alignment. Fixes rdar://problem/35747485.
2017-11-29 19:21:36 -08:00
Slava Pestov
cc9047dbc2 Merge pull request #13122 from slavapestov/revert-an-assert-sigh
Revert "AST: UnboundGenericTypes are not legal SIL types"
2017-11-28 19:36:36 -08:00