Fix some cases where "Camel Case.rst" is used instead of "CamelCase.rst".
File counts:
* Files in repo: 10 242
* Files in repo with spaces in file name: 10
* Files in repo with .rst suffix: 74
* Files in repo with .rst suffix and spaces in file name: 10
In addition to the consistency argument: spaces in file names create unnecessary
gotchas when it comes to bash scripting - see below.
Before this commit:
```
$ find . -name "*.rst" | xargs ls -dl > /dev/null
ls: cannot access ./docs/Dependency: No such file or directory
ls: cannot access Analysis.rst: No such file or directory
ls: cannot access ./docs/proposals/ObjC: No such file or directory
ls: cannot access Interoperation.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Argument: No such file or directory
ls: cannot access Interop.rst: No such file or directory
ls: cannot access ./docs/proposals/archive/Memory: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Concurrency: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/C: No such file or directory
ls: cannot access Pointer: No such file or directory
ls: cannot access Interop: No such file or directory
ls: cannot access Language: No such file or directory
ls: cannot access Model.rst: No such file or directory
ls: cannot access ./docs/proposals/rejected/Bridging: No such file or directory
ls: cannot access Container: No such file or directory
ls: cannot access Protocols: No such file or directory
ls: cannot access to: No such file or directory
ls: cannot access Class: No such file or directory
ls: cannot access Clusters.rst: No such file or directory
ls: cannot access ./docs/archive/Namespace: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Vars: No such file or directory
ls: cannot access and: No such file or directory
ls: cannot access Top: No such file or directory
ls: cannot access Level: No such file or directory
ls: cannot access Code.rst: No such file or directory
ls: cannot access ./docs/archive/Objective-C: No such file or directory
ls: cannot access Interoperability.rst: No such file or directory
ls: cannot access ./docs/Pattern: No such file or directory
ls: cannot access Matching.rst: No such file or directory
ls: cannot access ./docs/Failable: No such file or directory
ls: cannot access Initializers.rst: No such file or directory
$
```
After this commit:
```
$ find . -name "*.rst" | xargs ls -dl > /dev/null
$
```
Similarly to how we've always handled parameter types, we
now recursively expand tuples in result types and separately
determine a result convention for each result.
The most important code-generation change here is that
indirect results are now returned separately from each
other and from any direct results. It is generally far
better, when receiving an indirect result, to receive it
as an independent result; the caller is much more likely
to be able to directly receive the result in the address
they want to initialize, rather than having to receive it
in temporary memory and then copy parts of it into the
target.
The most important conceptual change here that clients and
producers of SIL must be aware of is the new distinction
between a SILFunctionType's *parameters* and its *argument
list*. The former is just the formal parameters, derived
purely from the parameter types of the original function;
indirect results are no longer in this list. The latter
includes the indirect result arguments; as always, all
the indirect results strictly precede the parameters.
Apply instructions and entry block arguments follow the
argument list, not the parameter list.
A relatively minor change is that there can now be multiple
direct results, each with its own result convention.
This is a minor change because I've chosen to leave
return instructions as taking a single operand and
apply instructions as producing a single result; when
the type describes multiple results, they are implicitly
bound up in a tuple. It might make sense to split these
up and allow e.g. return instructions to take a list
of operands; however, it's not clear what to do on the
caller side, and this would be a major change that can
be separated out from this already over-large patch.
Unsurprisingly, the most invasive changes here are in
SILGen; this requires substantial reworking of both call
emission and reabstraction. It also proved important
to switch several SILGen operations over to work with
RValue instead of ManagedValue, since otherwise they
would be forced to spuriously "implode" buffers.
The main change is that @always_emit_into_client is now not considered a
versioned attribute: either you use it up front and the entity is not part
of your ABI, or you don't and it is. Everything else falls out from that.
Describe a new attribute, @always_emit_into_client, which covers the
behavior of helpers for inlineable functions: any client that makes use
of the body of an inlineable function should use that implementation,
including any helper functions, local functions, or closures referenced
therein. This is also a tool a library developer can use.
This is a nice change because it formalizes several things that were
previously special-cased; however, there are still some open questions.
It's not totally clear whether we want separate @inlineable and
@always_emit_into_client annotations; we could attempt to get away with
just the latter. However, as noted in the diff, there are some entities
that can't really be completely eliminated from the ABI, so marking them
@always_emit_into_client would be disingenuous.
...from JoeG, Dmitri, and David Owens.
- Add an explicit section on default arguments.
- Replace the phrase "permitted but discouraged" with a new and stronger
term "binary-compatible source-breaking change". This may need more
work but it is an improvement.
- Mark that we could make converting get-only 'var' to 'let' safe.
- Adding a required convenience init is safe with certain restrictions.
- Add some more related proposals.
- Add a todo list for more substantive changes and ongoing discussion.
- Assorted clarifications and typo fixes.
* Replace 'Fast' with 'Unchecked' everywhere.
* Update the help text to specify DisableReplacement rather than
Replacement and to document Unchecked.
* Simplify tests slightly and add a tests for Unchecked.
...by giving all the types silly magic-themed names, rather than just
'Base' or 'SomeProto'. That makes a (mostly) consistent theme throughout
the document, and hopefully makes it easier to have a mental model
about what various changes mean.
This will be used to help IRGen record protocol requirements
with resilient default implementations in protocol metadata.
To enable testing before all the Sema support is in place, this
patch adds SIL parser, printer and verifier support for default
witness tables.
For now, SILGen emits empty default witness tables for protocol
declarations in resilient modules, and IRGen ignores them when
emitting protocol metadata.
I realized "members are mostly the same as their top-level equivalents" is worth
calling out explicitly, especially for subscripts and initializers without top-level
equivalents. There's still a hole here for members of protocol extensions, which can
have pretty drastic effects on conforming types.
"Proposal" refers to something going through the Swift Evolution Process,
which this won't as such. (Although it does have many pieces affected by
proposals, as described at the end of the document.)
Basically, elaborate on why it's not important right now. Also, drop the
section on limiting the addition of new vtable-dispatched methods. That's
not something we're really interested in.
The Default Behavior Should Be Safe
Also, remove the line about "providing tools to check changes", because
it no longer fits in the prologue flow and isn't core to the model.
The section on it is good enough.
I went through the list of attributes and declaration modifiers and
made sure they were all accounted for. Anything not on the list
should be assumed restricted, as mentioned at the top of the
"Supported Evolution" section.
- Implement emission of type references for nominal type field
reflection, using a small custom encoder resulting in packed
structs, not strings. This will let us embed 7-bit encoded
32-bit relative offsets directly in the structure (not yet
hooked in).
- Use the AST Mangler for encoding type references
Archetypes and internal references were complicating this before, so we
can take the opportunity to reuse this machinery and avoid unique code
and new ABI.
Next up: Tests for reading the reflection sections and converting the
demangle tree into a tree of type references.
Todo: For concrete types, serialize the types for associated types of
their conformances to bootstrap the typeref substitution process.
rdar://problem/15617914
...most of which don't exist yet. These are things that need to go
through the Swift Evolution Process and ultimately be accepted or
rejected before we have final answers on some parts of the document.
As part of SE-0022, introduce an 'objc_selector' encoding for string
literals that places the UTF-8 string literal into the appropriate
segment for uniquing of Objective-C selector names.
Specifically, public members (and nested types) within a versioned type are
assumed to be present on the outer type since its introduction unless otherwise
specified. (This saves boilerplate for a type's initial API.)
Instead of directly emitting calls to swift_getGenericMetadata*() and
referencing metadata templates, call a metadata accessor function
corresponding to the UnboundGenericType of the NominalTypeDecl.
The body of this accessor forwards arguments to a runtime metadata
instantiation function, together with the template.
Also, move some code around, so that metadata accesses which are
only done as part of the body of a metadata accessor function are
handled separately in emitTypeMetadataAccessFunction().
Apart from protocol conformances, this means metadata templates are
no longer referenced from outside the module where they were defined.
This drops the requirement that a fixed-layout struct only contain fixed-size
things (which wasn't specified correctly anyway). Slava and Dmitri both
pointed out that the previous definition had several flaws, including not
really scaling to generics. This reduced version only promises that stored
instance properties won't be added, removed, or modified, which is still
enough to do useful optimizations. And in most cases, we'll be able to
infer the full "fixed-size" property of a type from this attribute anyway.
The name "fixed-contents" was chosen to force us to pick a better name later.
The next commit will bring back the "fixed-size" property as a performance
assertion.