Commit Graph

2525 Commits

Author SHA1 Message Date
Jordan Rose
7d8acefd3d [docs] Update SIL.rst for the new verifier checks on enum instructions (#18450) 2018-08-01 13:12:18 -07:00
adrian-prantl
796489960f Merge pull request #18366 from adrian-prantl/28859432
Add debug info support for inlined and specialized generic variables.
2018-08-01 07:19:01 -07:00
Adrian Prantl
58475ef1ad Add debug info support for inlined and specialized generic variables.
This patch adds SIL-level debug info support for variables whose
static type is rewritten by an optimizer transformation. When a
function is (generic-)specialized or inlined, the static types of
inlined variables my change as they are remapped into the generic
environment of the inlined call site. With this patch all inlined
SILDebugScopes that point to functions with a generic signature are
recursively rewritten to point to clones of the original function with
new unique mangled names. The new mangled names consist of the old
mangled names plus the new substituions, similar (or exactly,
respectively) to how generic specialization is handled.

On libSwiftCore.dylib (x86_64), this yields a 17% increase in unique
source vars and a ~24% increase in variables with a debug location.

rdar://problem/28859432
rdar://problem/34526036
2018-07-31 16:59:56 -07:00
swift-ci
ba180c5dc5 Merge pull request #18413 from atrick/docs 2018-07-31 16:44:24 -07:00
Andrew Trick
3ab515b198 SILProgrammer's manual. Remove a couple remnants of fake SIL syntax. 2018-07-31 13:51:14 -07:00
Alejandro
d0037492ce [Docs] Fix minor code typo in SILPro..Man..md 2018-07-31 14:29:42 -04:00
Andrew Trick
f6ba49e292 Add docs/SILDevelopment.rst.
Document SILFunction and `apply` arguments.

Create TBD headers to give the document some form.
2018-07-27 11:02:01 -07:00
John McCall
dc052e6364 Resolve metadata cycles through non-generic value types with resilient layout.
The central thrust of this patch is to get these metadata initializations
off of `swift_once` and onto the metadata-request system where we can
properly detect and resolve dependencies.  We do this by first introducing
runtime support for resolving metadata requests for "in-place"
initializations (committed previously) and then teaching IRGen to actually
generate code to use them (this patch).

A non-trivial amount of this patch is just renaming and refactoring some of
existing infrastructure that was being used for in-place initializations to
try to avoid unnecessary confusion.

The remaining cases that are still using `swift_once` resolution of
metadata initialization are:

- non-generic classes that can't statically fill their superclass or
  have resilient internal layout

- foreign type metadata

Classes require more work because I'd like to switch at least the
resilient-superclass case over to using a pattern much more like what
we do with generic class instantiation.  That is, I'd like in-place
initialization to be reserved for classes that actually don't need
relocation.

Foreign metadata should also be updated to the request/dependency scheme
before we declare ABI stability.  I'm not sure why foreign metadata
would ever require a type to be resolved, but let's assume it's possible.

Fixes part of SR-7876.
2018-07-25 15:21:55 -04:00
Bob Wilson
5a96941803 Add doc whitespace to fix Sphinx error. 2018-07-24 21:13:41 -07:00
Doug Gregor
a2b2798de2 [ABI] Eliminate the now-unused protocol requirement array.
This is a holdover from the old protocol descriptor layout, which is no
longer useful.
2018-07-24 17:33:16 -07:00
swift-ci
cf501b4f71 Merge pull request #18163 from DougGregor/protocol-context-descriptor 2018-07-24 15:00:04 -07:00
Jordan Rose
e0c3c725f9 [docs] Update TransparentAttr.rst for '@inlinable' (#18170) 2018-07-24 12:40:26 -07:00
Doug Gregor
e7998f1846 [ABI] Record unmangled names in Swift protocol descriptors.
Rather than storing a mangled name in a Swift protocol descriptor,
which encodes information that is redundant with the context of the
protocol, store an unmangled name as in nominal type descriptors. Update
the various places where this name is used to extract the demangle
tree from the context descriptors.
2018-07-24 04:25:13 -07:00
Doug Gregor
a54a6d8d7f [ABI] Rework protocol descriptor metadata.
Reimplement protocol descriptors for Swift protocols as a kind of
context descriptor, dropping the Objective-C protocol compatibility
layout. The new protocol descriptors have several advantages over the
current implementation:

* They drop all of the unused fields required for layout-compatibility
  with Objective-C protocols.
* They encode the full requirement signature of the protocol. This
  maintains more information about the protocol itself, including
  (e.g.) correctly encoding superclass requirements.
* They fit within the general scheme of context descriptors, rather than
  being their own thing, which allows us to share more code with
  nominal type descriptors.
* They only use relative pointers, so they’re smaller and can be placed
  in read-only memory

 Implements rdar://problem/38815359.
2018-07-23 22:12:42 -07:00
Doug Gregor
c56879da73 [ABI] Update ABI documentation to match existential metadata layout. 2018-07-23 17:10:00 -07:00
John McCall
7a4aeed570 Implement generalized accessors using yield-once coroutines.
For now, the accessors have been underscored as `_read` and `_modify`.
I'll prepare an evolution proposal for this feature which should allow
us to remove the underscores or, y'know, rename them to `purple` and
`lettuce`.

`_read` accessors do not make any effort yet to avoid copying the
value being yielded.  I'll work on it in follow-up patches.

Opaque accesses to properties and subscripts defined with `_modify`
accessors will use an inefficient `materializeForSet` pattern that
materializes the value to a temporary instead of accessing it in-place.
That will be fixed by migrating to `modify` over `materializeForSet`,
which is next up after the `read` optimizations.

SIL ownership verification doesn't pass yet for the test cases here
because of a general fault in SILGen where borrows can outlive their
borrowed value due to being cleaned up on the general cleanup stack
when the borrowed value is cleaned up on the formal-access stack.
Michael, Andy, and I discussed various ways to fix this, but it seems
clear to me that it's not in any way specific to coroutine accesses.

rdar://35399664
2018-07-23 18:59:58 -04:00
Daniel Zheng
0f430e5251 Merge branch 'master' into generics-manifesto-typo 2018-07-18 16:11:17 -07:00
Daniel Zheng
2dc279fa47 [Docs] Minor edits to GenericsManifesto.md.
Address comments by @CodaFi regarding capitalization.
2018-07-18 14:18:42 -07:00
swift-ci
9c99ee1761 Merge pull request #17927 from Dandigit/master 2018-07-17 14:30:53 -07:00
Jordan Rose
4949fcd830 [docs] LibraryEvolution: Non-controversial updates for Swift 4.2 (#17869)
- Standardize on "inlinable" instead of "inlineable", per SE-0193.
- Standardize on "frozen enums" instead of "closed enums", even though
  SE-0192 wasn't quite conclusive on this.
- Typealiases are treated as versioned entities for the purpose of
  verifying availability.
- Per SE-0193, inlinable functions do not have always-emit-into-client
  behavior.
- Rename the fragility attribute for properties and subscripts to
  '@inlinableAccess' for now, since '@inlinable' has been implemented
  for functions now. (We may still end up choosing to use the same
  name for these declarations too.)
- Private and fileprivate entities cannot be '@inlinable' today.
- We implemented the always-emit-into-client change for default
  arguments. They also have even stricter restrictions than most
  inlinable functions.
- A struct initializer can also assign to 'self' instead of delegating
  with `self.init`.
- Disallow adding new associated types to protocols for now.
- Mention that precedence groups exist.
- Mention that '@usableFromInline' exists.
- '@inlinable' can be backdated, even though all the other fragility
  attributes cannot.
- Tweak TODO around '@NSManaged'.
- Tweak list of planned proposals.

This document still deserves some more drastic restructuring to
separate the near-term features from the long-term features.
2018-07-16 15:40:29 -07:00
Dandigit
e745b9e270 Clarify WSL article link 2018-07-13 22:13:38 +10:00
Dandigit
4470d40192 Clarified article title, updated MSDN link 2018-07-13 22:12:01 +10:00
Dandigit
4f0a2645c6 Update WindowsSubsystemForLinux.md 2018-07-13 22:10:38 +10:00
Slava Pestov
330be4a38e SILOptimizer: Remove 'unique ID' from FSO mangling 2018-07-11 15:29:45 -07:00
Adrian Prantl
fdad9076f2 Revert "Add debug info support for inlined and specialized generic variables."
There is an assertion failure building the source compatibility suite that
needs to be investigated.

This reverts commit 91f6f34119.
2018-07-07 13:01:01 -07:00
Adrian Prantl
91f6f34119 Add debug info support for inlined and specialized generic variables.
This patch adds SIL-level debug info support for variables whose
static type is rewritten by an optimizer transformation. When a
function is (generic-)specialized or inlined, the static types of
inlined variables my change as they are remapped into the generic
environment of the inlined call site. With this patch all inlined
SILDebugScopes that point to functions with a generic signature are
recursively rewritten to point to clones of the original function with
new unique mangled names. The new mangled names consist of the old
mangled names plus the new substituions, similar (or exactly,
respectively) to how generic specialization is handled.

On libSwiftCore.dylib (x86_64), this yields a 17% increase in unique
source vars and a ~24% increase in variables with a debug location.

rdar://problem/28859432
rdar://problem/34526036
2018-07-06 22:06:48 -07:00
Ole Begemann
f8ad1a1bb6 [Docs] Fix broken markup in Request-Evaluator (#17793) 2018-07-06 12:15:35 -05:00
Doug Gregor
ef58259cd3 [Docs] Add another idea for the request-evaluator. 2018-07-05 22:43:27 -07:00
Doug Gregor
4682136903 [Docs] Add some more "open projects" for the request-evaluator. 2018-07-05 22:33:17 -07:00
Doug Gregor
a6a1f03148 [Docs] Add some documentation for the request-evaluator. 2018-07-05 22:24:38 -07:00
kitasuke
8e591b0820 Fix wrong blockquote 2018-07-01 17:35:04 +09:00
Robert Widmann
9aae5a6c5c Merge pull request #17513 from spencerkohan/patch-1
[Docs] Fix a typo in docs/WindowsCrossCompile.md
2018-06-28 07:22:05 -07:00
swift-ci
15c61cb442 Merge pull request #17572 from AndrewSB/patch-4 2018-06-27 18:44:10 -07:00
Michael Gottesman
e29c61e73e Merge pull request #17560 from gottesmm/pr-9d67c5b273eaafb2b9bb9f0568014de4ab1296af
[docs] Add a small section about running the static analyzer via clan…
2018-06-27 17:02:21 -07:00
Andrew Breckenridge
bcb3fe398f docs/Android: fix typo in build script invocation
@lanza please smoke test
2018-06-27 15:40:58 -07:00
Michael Gottesman
4a0409c1ff [docs] Add a link in DebuggingTheCompiler to the manual symbolication lldb guide on llvm.org 2018-06-27 09:21:27 -07:00
Michael Gottesman
35c99da8cd [docs] Add a small section about running the static analyzer via clang-tidy using compile_commands.json
I have been doing this every once in a while to look for problems. No point in
siloing this knowledge in my brain.
2018-06-27 09:21:10 -07:00
AnnaZaks
62b73105b5 Merge pull request #17309 from dplanitzer/windows_docu_update_1
Updated the Windows build documentation:
2018-06-26 21:38:16 -07:00
Mishal Shah
21cf9b33c8 Update table of contents for CI doc 2018-06-26 12:13:41 -07:00
Mishal Shah
edd51d217d Update the doc for building swift toolchains with PR testing 2018-06-26 12:11:58 -07:00
Spencer Kohan
1b5c334f3c Fix a word
The line: "how to cross compile Swift on Windows" should read "how to cross compile Swift for Windows".  I believe this is a typo.
2018-06-26 10:43:32 +02:00
Michael Gottesman
968835a1ac Make Debugging Executables/LLDB top level section
Previously these were under "Debugging the Compiler"... but really they are more general so it makes sense for them to have their own sections.
2018-06-25 09:58:31 -07:00
swift-ci
16a13c8f07 Merge pull request #17455 from graydon/batch-mode-docs-update 2018-06-23 01:24:26 -07:00
Graydon Hoare
19eab4fe6b [Docs] Update CompilerPerformance.md to cover batch mode. 2018-06-22 23:52:44 -07:00
danielzheng
b3f81474c6 [Docs] Fix typo in GenericsManifesto.md.
Minor clarification to "opening existentials" example.
2018-06-22 22:04:52 -07:00
David Ungar
794a3d748d Merge pull request #16669 from davidungar/refdep-refactor
NFC, [Incremental Compilation] Refactor ReferenceDependencies
2018-06-22 10:14:36 -07:00
Dietmar Planitzer
47d30ee445 Updated the Windows build documentation:
- made the build type consistent across all subprojects
- point out that the release build may crash
- link the Swift compiler and runtime libraries with incremental linking turned off
- suppress expected warnings
- added missing build parameters to the lldb cmake invocation line
- added simple installation instructions
2018-06-22 10:08:50 -07:00
Adrian Prantl
630596d308 Remove obsolete DWARF Archetype mangling 2018-06-21 11:41:48 -07:00
Doug Gregor
833cd01996 [Mangling] Fix incorrect documentation for Swift.Dictionary standard substitution 2018-06-20 14:47:34 -07:00
Doug Gregor
f232af5535 [Mangling] Allow standard substitutions in protocol mangling.
Protocol name mangling didn’t always go through a path that allowed the use
of standard substitutions. Enable standard substitutions for protocol name
manglings where they make sense.

Removes ~277k from the standard library binary size.
2018-06-19 23:24:38 -07:00