Commit Graph

2998 Commits

Author SHA1 Message Date
Jordan Rose
6c2645a288 [docs] LibraryEvolution: make it a little more friendly
- Move the original intro into a "Background" section
- Link to SE-0193 (@inlinable) and SE-0260 (@frozen)
- Note (suggested by @Gankra) on why it's safe to add stored
  properties to a struct
- Remove some bits that reference the content removed in earlier
  commits
- Other minor copyediting
2019-11-01 14:56:30 -07:00
Brent Royal-Gordon
17169fc1fe Merge pull request #27950 from brentdax/dumpster-fire
[NFC] Standardize dump() methods in frontend
2019-10-31 20:36:26 -07:00
Brent Royal-Gordon
99faa033fc [NFC] Standardize dump() methods in frontend
By convention, most structs and classes in the Swift compiler include a `dump()` method which prints debugging information. This method is meant to be called only from the debugger, but this means they’re often unused and may be eliminated from optimized binaries. On the other hand, some parts of the compiler call `dump()` methods directly despite them being intended as a pure debugging aid. clang supports attributes which can be used to avoid these problems, but they’re used very inconsistently across the compiler.

This commit adds `SWIFT_DEBUG_DUMP` and `SWIFT_DEBUG_DUMPER(<name>(<params>))` macros to declare `dump()` methods with the appropriate set of attributes and adopts this macro throughout the frontend. It does not pervasively adopt this macro in SILGen, SILOptimizer, or IRGen; these components use `dump()` methods in a different way where they’re frequently called from debugging code. Nor does it adopt it in runtime components like swiftRuntime and swiftReflection, because I’m a bit worried about size.

Despite the large number of files and lines affected, this change is NFC.
2019-10-31 18:37:42 -07:00
Saleem Abdulrasool
c028475065 Update WindowsBuild.md
Correct paths for one-time setup
2019-10-31 15:51:37 -07:00
Saleem Abdulrasool
b4b4b9f9ef Update WindowsBuild.md
Further improvements to the text and simplifications to the directions for building on Windows.
2019-10-30 16:35:06 -07:00
Saleem Abdulrasool
8afd60c97c Merge pull request #27958 from apple/compnerd-windows-instructions
Update WindowsBuild.md
2019-10-30 12:20:12 -07:00
Dan Zheng
07880d168f [Docs] Differentiable programming manifesto. (#27034) 2019-10-30 12:14:23 -07:00
Saleem Abdulrasool
5f50f67254 Update WindowsBuild.md
- remove numbers on steps, they get out of sync and auto-numbering headers doesn't work
- correct some header titles
- re-render the tree to be ascii pretty
- split out "one-time setup" from "getting started"
- fix invocation of cmake for toolchain
- fix libdispatch build rules
- convert libdispatch build rules to be copy-paste friendly
- add libdispatch test instructions
2019-10-30 09:04:13 -07:00
Jordan Rose
312fefccc5 Merge pull request #27889 from jrose-apple/fire-water-air-metal-earth
[docs] CToSwift: Add section on methods
2019-10-29 16:58:49 -07:00
Jordan Rose
0b6d0be873 [docs] LibraryEvolution: Property wrappers, @dynamicCallable...
...and function builders, even though those haven't formally been
accepted to the language yet. (This description of property wrappers
is also a bit optimistic; at the time of this writing, they haven't
been implemented for top-level variables yet.)
2019-10-29 15:16:07 -07:00
Jordan Rose
96f99d2fb2 [docs] LibraryEvolution: Bring the per-decl restrictions up to date
And replace the term "versioned" with "ABI-public".
2019-10-29 15:16:07 -07:00
Jordan Rose
628d7bf1e9 [docs] LibraryEvolution: Remove discussion of versioning...
...as well as the "Open Issues" section and some future directions.
I'll put this back in a different form soon.
2019-10-29 15:16:07 -07:00
Jordan Rose
ab72b999ee [docs] CToSwift: Tweak wording around "overrides"
The previous wording referred to a method or property satisfying a
protocol requirement as an "override", which both Clang and the Swift
Clang Importer use internally sometimes. But most people who program
Objective-C (or Swift) don't think of this as an override, so this
document shouldn't use that language. (Thanks, Varun!)
2019-10-29 09:58:16 -07:00
Robert Widmann
28b66f6225 Switch DeclValidation Counter to Request Counter
Now that validateDecl is gone, stop duplicating work here and use the
request counter instead.
2019-10-28 15:36:50 -07:00
Mishal Shah
2e9b6b8582 Merge pull request #27859 from apple/shahmishal/update-branch-info
[Doc] Update the Branches doc with LLVM Project info
2019-10-27 20:47:32 -07:00
Michael Gottesman
7ee5ad7318 [sil] Rename {,Strong}Copy{Unowned,Unmanaged}. 2019-10-26 17:03:47 -07:00
Saleem Abdulrasool
be47c9734c Merge pull request #27869 from apple/compnerd-monorepo-windows
Update WindowsBuild.md
2019-10-26 13:50:14 -07:00
Jordan Rose
618afde2a6 [docs] CToSwift: Add section on methods
There's a lot here, so I might have missed something, but I think this
document is complete!
2019-10-25 15:38:01 -07:00
Mishal Shah
ce62b92949 [Doc] Update the llvm release branch to new llvm branch 2019-10-25 10:28:39 -07:00
Mishal Shah
58479bd552 [Doc] Update the release branch and format for the table 2019-10-24 22:06:53 -07:00
Jordan Rose
d6117a43b7 [docs] CToSwift: document omit-needless-words (#27749)
...and update the dirty lie that property names aren't transformed.

The only thing left to do is methods!
2019-10-24 18:35:33 -07:00
Michael Gottesman
71090c27ee Merge pull request #27375 from gottesmm/pr-37fe7a0a42201ad83ffbe950c9b552addfb01e4d
[sil.rst] Try to make it clearer that copy_unmanaged_value performs a…
2019-10-24 18:32:29 -07:00
Saleem Abdulrasool
1b31094a36 Update WindowsBuild.md
Update for the monorepo.
2019-10-24 15:38:17 -07:00
Jonas Devlieghere
40e5924f60 Merge pull request #27814 from JDevlieghere/use-static-bindings
[CMake] Fix the static bindings workflow.
2019-10-24 09:20:19 -07:00
Mishal Shah
982afa0784 [Doc] Update the Branch doc with LLVM Project info 2019-10-23 23:28:12 -07:00
Saleem Abdulrasool
7ca58accc8 Update WindowsBuild.md
Remove clone commands for curl and libxml2 as they are prebuilt now.
2019-10-23 21:25:10 -07:00
Jonas Devlieghere
ec21125988 [CMake] Fix the static bindings workflow.
Rename LLDB_ALLOW_STATIC_BINDINGS to LLDB_USE_STATIC_BINDINGS and make
LLDB use the static bindings unconditionally when it's set. The current
variable is opaque because it allows LLDB to use the static bindings,
but only if SWIG is not found. If an incompatible version of swig is
found, it reports a fatal error. This serves no purpose other than to
confuse the user.

The corresponding LLDB patch simplifies things and makes the variable do
what you expect. When enabled, LLDB uses the static bindings. When
disabled, we try to generate them with SWIG.

This patch modifies the build scripts to pass the new variable.
2019-10-21 14:39:25 -07:00
Robert Widmann
6942d36f87 Merge pull request #27764 from CodaFi/interface-type-request
Define InterfaceTypeRequest
2019-10-17 20:07:21 -07:00
Robert Widmann
72da97069e Expunge validateDecl from documentation 2019-10-17 16:11:41 -07:00
Puyan Lotfi
08e64f8679 Update WindowsBuild.md
Adding updated instructions for building on windows.
2019-10-17 15:07:55 -07:00
Saleem Abdulrasool
d5b761c0e1 Update WindowsBuild.md
Remove time references, they do not add to the instructions.
2019-10-12 17:37:32 -07:00
Saleem Abdulrasool
1e0d92749f Update WindowsBuild.md
Update instructions for building LLDB
2019-10-02 11:30:11 -07:00
Jordan Rose
1bb666a362 [docs] CToSwiftName: Add the section on ObjC properties
Fairly simple except in the few cases they aren't.
2019-10-01 20:08:08 -07:00
Jordan Rose
dfe0085aea [docs] CToSwift: Finish swift_name section
Struct/union fields, ObjC properties, ObjC methods
2019-10-01 20:08:06 -07:00
Jordan Rose
3afbe31f54 Merge pull request #27448 from owenv/verifier_docs
[Docs] Add a section to Diagnostics.md on -verify mode
2019-10-01 10:58:35 -07:00
Owen Voorhees
f749e8551f [Docs] Add a section to Diagnostics.md on -verify mode 2019-09-30 17:14:32 -07:00
Jordan Rose
40fdae4a8a [docs] CToSwift: remove the import-as-member-subscript discussion
This fits in the model but was never implemented, so take it back out.
2019-09-27 20:14:07 -07:00
Jordan Rose
a6dd630ca3 Eliminate Builtin.UnknownObject as an AST type (#27378)
This removes it from the AST and largely replaces it with AnyObject
at the SIL and IRGen layers. Some notes:

- Reflection still uses the notion of "unknown object" to mean an
  object with unknown refcounting. There's no real reason to make
  this different from AnyObject (an existential containing a
  single object with unknown refcounting), but this way nothing
  changes for clients of Reflection, and it's consistent with how
  native objects are represented.

- The value witness table and reflection descriptor for AnyObject
  use the mangling "BO" instead of "yXl".

- The demangler and remangler continue to support "BO" because it's
  still in use as a type encoding, even if it's not an AST-level
  Type anymore.

- Type-based alias analysis for Builtin.UnknownObject was incorrect,
  so it's a good thing we weren't using it.

- Same with enum layout. (This one assumed UnknownObject never
  referred to an Objective-C tagged pointer. That certainly wasn't how
  we were using it!)
2019-09-26 17:48:04 -07:00
Michael Gottesman
a84497b834 [sil.rst] Try to make it clearer that copy_unmanaged_value performs a "strong copy" of the underlying value. 2019-09-25 18:59:07 -07:00
Doug Gregor
ab5d161c05 [SILGen] Separate the initialization of a wrapped property from a wrapped value
Teach SILGen to emit a separate SIL function to capture the
initialization of the backing storage type for a wrapped property
based on the wrapped value. This eliminates manual code expansion at
every use site.
2019-09-24 09:11:53 -07:00
Jordan Rose
4ade7ae11f [docs] CToSwift: swift_name for all top-level declarations (#27227)
That is: types, globals, C functions, and enumerators, including a
discussion of import-as-member for each. Still more to come:
swift_name for properties, methods, and struct fields.
2019-09-19 16:31:41 -07:00
Varun Gandhi
2255e81ad0 [NFC] Replacing potentially confusing phrase "memory allocation promotion" 2019-09-18 10:30:36 -07:00
Andrew Trick
7b1b0a0077 Add comments to destroy_addr in SIL.rst.
`destroy_addr` is never semantically a "no-op". Just because an
instruction can be safely eliminated does not mean the instruction has
no semantics! That would be like saying we could move an unknown
memory read below an otherwise dead store!
2019-09-12 16:21:39 -07:00
Jordan Rose
ec862c5b4d Merge pull request #27118 from jrose-apple/translation-reflection-but-what-about-rotation
[docs] CToSwift: CF types, protocols, and swift_private
2019-09-12 09:58:07 -07:00
Jordan Rose
2d63ae4133 [docs] CToSwift: Describe swift_private (prepend '__') 2019-09-11 19:45:10 -07:00
Jordan Rose
afecd41904 [docs] CToSwift: Objective-C Protocols ("Protocol" appended) 2019-09-11 09:16:00 -07:00
Jordan Rose
9cc26ef7a2 [docs] CToSwift: CF types (how they're recognized + dropping "Ref") 2019-09-11 09:16:00 -07:00
Jordan Rose
7aeeb0d508 [docs] CToSwift: Move word-splitting into its own section
It's used all over the place in name importing, not just for enums.
2019-09-11 09:16:00 -07:00
Erik Eckstein
3d0b12e7bc MemoryLifetime: fix a problem where DestroyHoisting moved a destroy_addr before a use of a trivial type.
Even if a destroy_addr of a trivial type is a no-op, we must not end up with using such a value after a destroy_addr.
The fix is to also handle aggregate fields of trivial types in MemoryLifetime.

rdar://problem/55125020
2019-09-11 13:49:23 +02:00
Joe Groff
6817c53031 Mangle associated types of opaque types like dependent member types.
The archetype mangling does not have enough information to accurately recover the associated type
at runtime. This fixes rdar://problem/54084733.

Although this changes the mangling in both runtime and symbols, this should not affect ABI, because
there is no way for associated types of opaque types to be surfaced in the types of public
declarations today.
2019-09-04 10:20:10 -07:00