Commit Graph

2998 Commits

Author SHA1 Message Date
Jordan Rose
682c45ca60 [docs] Start a doc on ClangImporter C->Swift name mapping (#26947)
Includes enums in all their flavors, plus swift_wrapper structs.
Planned future content:

- Methods, initializers, properties
  - "Omit-needless-words" rules
  - NSError
  - Boolean properties
  - Inferred default arguments
  - Factory methods as initializers
- Protocols (mainly just that they check for collision)
- CF types (low-priority since non-Apple people can't make them)
- Custom names, including import-as-member and import-as-accessor
- swift_private
2019-09-03 15:16:29 -07:00
Jordan Rose
7e9e4b5e5b Merge pull request #26836 from owenv/select_modifier_str_support
[Diagnostics][NFC] Add support for using the %select format specifier…
2019-08-26 16:58:54 -07:00
Owen Voorhees
486c7b883d [Diagnostics][NFC] Add support for using the %select format specifier with StringRef args
Get rid of some redundant availability diagnostics as a result.
2019-08-26 11:37:29 -07:00
Michael Gottesman
d05dc8ac31 [SIL.rst] Add docs for copy_unowned_value and copy_unmanaged_value.
This commit adds docs for copy_unmanaged_value to SIL.rst as requested by
@eeckstein in #26839. I noticed while doing the PR that copy_unowned_value was
also not documented, so I added docs for it as well as a bonus. = ).
2019-08-26 09:28:16 -07:00
Alex Langford
61be4d969f [CMake][NFC] Introduce component targets for proper dependency tracking
This commit introduces a CMake target for each component, adds install targets
for them, and switches build-script-impl to use the target `install-components`
for installation. Each of the targets for each component depends on each
of the individual targets and outputs that are associated with the
corresponding swift-component.

This is equivalent to what already exists, because right now install rules are
only generated for components that we want to install. Therefore, this commit
should be an NFC.

This is a resubmission (with modifications) of an earlier change. I originally
committed this but there were problems with some installation rules.
2019-08-22 10:16:50 -07:00
Joe Groff
ca4c2211b9 Merge pull request #26523 from rxwei/clarify-partial-apply-inout-aliasable
[Docs] Clarify partial_apply's ownership of @inout_aliasable arguments.
2019-08-10 11:42:15 -07:00
Harlan Haskins
7f07db5466 Merge pull request #26481 from owenv/print_diag_names
Add -debug-diagnostic-names frontend flag
2019-08-09 15:44:26 -07:00
Erik Eckstein
282907fc0a Fix property wrappers with tuples.
In case of a tuple as value type, the initializer and setter takes the tuple elements as separate arguments. This was just not handled in the assign_by_wrapper instruction lowering.

rdar://problem/53866473
2019-08-08 21:46:08 +02:00
Karoy Lorentey
ef93be28a9 Update StandardLibraryProgrammersManual.md 2019-08-07 17:40:45 -07:00
Saleem Abdulrasool
f6f1bf5d01 Merge pull request #26477 from apple/rxwei-patch-6
[Docs] Fix typo in SIL.rst.
2019-08-06 18:31:30 -07:00
Richard Wei
ffa9c40047 [Docs] Clarify partial_apply's ownership of @inout_aliasable arguments.
`partial_apply` does not own `@inout_aliasable` arguments, so the original description "the closure does however take ownership of the partially applied arguments" is not accurate. This patch makes things clear.
2019-08-06 15:50:00 -07:00
lbodner
fa6ae17cd7 Add missing '-parse-as-library' flag 2019-08-06 09:49:23 +02:00
Owen Voorhees
e7a1a1cc3d Add -debug-diagnostic-names frontend flag
This flag adds diagnostic names to the end of their messages, e.g. 'error: cannot convert value of type '[Any]' to specified type '[Int]' [cannot_convert_initializer_value]'. It's intended to be used for debugging purposes when working on the compiler.
2019-08-05 18:54:21 -07:00
Richard Wei
642cc3c074 [Docs] Fix typo in SIL.rst.
"an `@noescape`" -> "a `@noescape`"
2019-08-03 11:38:57 +02:00
Richard Wei
6ddfd1506f [Docs] Conditional conformances are implemented. (#26359)
Update Generics Manifesto to mark conditional conformances implemented.
2019-08-03 11:17:27 +02:00
Andrew Trick
0b3255fe2c Correct my minor typo in the stdlib programmer guide. 2019-08-02 17:14:27 -07:00
Saleem Abdulrasool
0f25b88bae docs: add initial documentation for android SDK
This adds documentation to build the android SDK (standard library,
libdispatch, foundation, and XCTest) for Android on Windows.  This is
pretty bare abut provides a line in the sand from where we can improve
the documentation for cross-compilation, building just the SDK, and
android specific items.
2019-07-26 15:53:08 -07:00
Argyrios Kyrtzidis
0135e01d02 Rename the swift-format utility to swift-indent
This is to distinguish the C++ indenting functionality from the new formatter that is written in Swift.
2019-07-26 11:40:54 -07:00
Andrew Trick
e75f551268 Add unsafeBitCast documentation to the Standard Library Programmer's Guide
Explaining the many other ways that one can cast references.
2019-07-17 19:40:25 -07:00
Karoy Lorentey
649b2db14e Start merging information from AccessControlInStdlib.rst 2019-07-17 17:18:20 -07:00
Erik Eckstein
e2d313ef68 SIL: Extend cond_fail by a second operand, which is a static string literal, indicating the failure reason. 2019-07-12 14:03:13 +02:00
Erik Eckstein
67c4fcfbdc docs: fix synatax error in Mangling.rst 2019-07-12 11:47:57 +02:00
Karoy Lorentey
9eb943b9f3 Update StandardLibraryProgrammersManual.md 2019-07-11 19:29:36 -07:00
Doug Gregor
6418749ccd [Docs] Remove some irrelevant "open projects" for the request-evaluator 2019-07-10 17:28:14 -07:00
John McCall
2c9cfb9e61 Merge pull request #26019 from rjmccall/dependent-conf-mangling
Fixes for mangling dependent protocol conformances
2019-07-09 20:06:19 -04:00
John McCall
7095953f84 Fix the demangling of dependent protocol conformance refs.
When mangling a dependent protocol conformance ref, the mangler currently uses `0_` to mean an unknown index and `N_` to mean the index `N - 1`. Unfortunately, this is somewhat confused: `0_` is actually the mangling for index 1, and index 0 is supposed to be mangled as just `_`, so true indexes are actually offset by 2. So the first thing to do here is to clarify what's going on throughout the mangler, demangler, and ABI documentation.

Also, the demangler attempts to produce a `DependentProtocolConformance*` node with the appropriate child nodes and an optional index payload. Unfortunately, demangle nodes cannot have both children and a value payload, so whenever it creates a node with an index payload, the demangler will assert.  It does this whenever the mangled index is not 0; since (per above) the mangler always produces a non-zero mangled index in this production, the demangler will always assert when processing these. So clearly this is well-tested code, since +asserts builds will always trigger the demangler when mangling a name in the first place.  To fix this, we need to make the index a child of the mangling node instead of its payload; at the same time, we can make it store the semantically correct index value and just introduce a new `UnknownIndex` node to handle the `0_` case.  This is easy because all current clients ignore this information.

Finally, due to an apparent copy-and-paste error, the demangler attempts to produce a `DependentProtocolConformanceRoot` node for associated protocol conformances; this is easily resolved.

This fixes the crash in SR-10926 (rdar://51710424).  The obscurity of this crash --- which originally made us think it might be related to Error self-conformance --- is because it is only triggered when a function signature takes advantage of a concrete-but-dependent retroactive conformance, which (to be both concrete and dependent) must furthermore be conditional.  Testing the other cases besides a root conformance requires an even more obscure testcase.
2019-07-09 17:25:44 -04:00
Sasha Krassovsky
03a9ccc295 Update windows build guide 2019-07-08 16:45:14 -07:00
swift-ci
cc668c2406 Merge pull request #25336 from mikeash/objc-interop-docs 2019-07-02 14:20:03 -07:00
Karoy Lorentey
01f3d290cc Typo fix 2019-06-27 14:52:05 -07:00
Karoy Lorentey
bf57cdca3f [doc] Add an embryonic section on stdlib coding style 2019-06-26 17:29:24 -07:00
Michael Gottesman
bf92ec3fc0 Merge pull request #25712 from gottesmm/pr-0be5f27e6a89dac3baa362bd0094cd940f32d2f2
[docs/debugging-the-compiler] Move asserting on first diagnostic out …
2019-06-26 10:52:40 -07:00
Mishal Shah
97156bda1f [Doc] Update Swift Community-Hosted CI pull request testing trigger doc 2019-06-25 12:19:14 -07:00
Michael Gottesman
3e8b33fa41 [docs/debugging-the-compiler] Move asserting on first diagnostic out of the type checker section into its own section.
These options do not make sense just in the type checker section since they can
also be used to diagnose why SIL passes emit diagnostics as well.

Since the prose was originally written, I also added an additional option to
assert on the first warning emitting. I added that to the documentation.
2019-06-24 11:28:20 -07:00
Saleem Abdulrasool
0150ae52ca Update WindowsBuild.md
Update build rules for llbuild after CMake cleanups.
2019-06-14 11:37:47 -07:00
Slava Pestov
198e8d1a1f AST: Introduce a new debug-only mangling for @escaping @convention(block) functions
Our mangling did not encode if an Objective-C block was escaping or
not. This is not a huge problem in practice, but for debug info we
want type reconstruction to round-trip exactly. There was a previous
workaround to paper over this specific problem.

Remove the workaround, and add a new 'XL' mangling for escaping
blocks. Since we don't actually want to break ABI compatibility,
only use the new mangling in DWARF debug info.
2019-06-12 19:10:19 -07:00
Mike Ash
e39a2358dc [Docs] Start writing some docs about ObjC interop. 2019-06-10 17:16:58 -04:00
Saleem Abdulrasool
f242b685a8 Update WindowsBuild.md
Ensure that symlinks are handled properly on Windows, which are disabled by default.
2019-06-02 21:47:30 -07:00
Saleem Abdulrasool
516411db61 Update WindowsBuild.md
Fix stray case of ICU 63.1 path to 64.2
2019-06-01 19:53:47 -07:00
Joe Groff
269d306b9d Merge pull request #25123 from johnno1962/reg-docco
Document ABI registers
2019-05-31 13:50:22 -07:00
Saleem Abdulrasool
869bcfb364 docs: describe where the build system is evolving to
Add a manifesto which describes where the build infrastructure is slowly
evolving to.  Although a good chunk of the necessary work to enable this
is already in the tree, this helps explain the desired state to everyone
working on the project.
2019-05-31 12:39:39 -07:00
Gonsolo
616877af4a Spelling fix. 2019-05-31 14:57:04 +02:00
John Holdsworth
07750f5e1d Update docs/ABI/RegisterUsage.md
Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>
2019-05-31 06:15:07 +01:00
John Holdsworth
1ccb603b66 Update docs/ABI/RegisterUsage.md
Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>
2019-05-31 06:14:56 +01:00
John Holdsworth
4d8e052139 Update docs/ABIStabilityManifesto.md
Co-Authored-By: Xiaodi Wu <xiaodi.wu@gmail.com>
2019-05-31 06:14:45 +01:00
swift-ci
b794cf0c85 Merge pull request #25143 from eeckstein/doc-update 2019-05-30 11:57:28 -07:00
Erik Eckstein
f10c33dcb7 docs: add info to DebuggingTheCompiler on how to identify an optimizer bug. 2019-05-30 10:39:02 -07:00
John Holdsworth
84bf2f541b Move document, I'll leave it as it is however. 2019-05-30 18:23:24 +01:00
Saleem Abdulrasool
8ddd9f63ff Merge pull request #25109 from apple/compnerd-I-C-U
Update WindowsBuild.md
2019-05-30 09:56:48 -07:00
John Holdsworth
fccb83d0a4 Rename ABI file 2019-05-30 09:32:24 +01:00
Doug Gregor
c02ecf9859 [SE-0258] Rename to Property Wrappers 2019-05-29 22:17:50 -07:00