Commit Graph

641 Commits

Author SHA1 Message Date
Dave Lee
8a2513be7e fix #endif comment 2022-01-12 12:59:17 -08:00
Dave Lee
7912247ef9 flip condition order 2022-01-12 12:57:11 -08:00
swift-ci
32201f9234 Merge remote-tracking branch 'origin/main' into rebranch 2022-01-12 12:54:18 -08:00
Dave Lee
f17967447b Merge pull request #40772 from apple/Add-child-count-assert-in-mangleDependentGenericConformanceRequirement
Assert child count in mangleDependentGenericConformanceRequirement
2022-01-12 12:48:44 -08:00
Dave Lee
3fa590cece [Demangler] Remove no-op case of DEMANGLER_ASSERT 2022-01-11 09:24:34 -08:00
swift-ci
3fb96c900e Merge remote-tracking branch 'origin/main' into rebranch 2022-01-09 07:13:54 -08:00
Konrad `ktoso` Malawski
9438cf6b2e [Distributed] Func metadata operations and implement executeDistributedTarget entry (#40605)
* [Distributed] Implement func metadata and executeDistributedTarget

dont expose new entrypoints

able to get all the way to calling _execute

* [Distributed] reimplement distributed get type info impls

* [Distributed] comment out distributed_actor_remoteCall for now

* [Distributed] disable test on linux for now
2022-01-09 23:55:06 +09:00
swift-ci
834e655ae3 Merge remote-tracking branch 'origin/main' into rebranch 2022-01-08 18:54:28 -08:00
Michael Gottesman
5dc8b3879b [move-function] SILCloner/mangling changes to support converting inout_aliasable defer parameters to out parameters after move analysis. 2022-01-08 13:41:05 -08:00
Dave Lee
74091f0165 Add child count assert in mangleDependentGenericConformanceRequirement 2022-01-07 18:44:36 -08:00
swift-ci
59e21f8a71 Merge remote-tracking branch 'origin/main' into rebranch 2022-01-07 16:00:06 -08:00
Doug Gregor
61d35f07a4 Merge pull request #40766 from DougGregor/mangle-multiple-opaque-types
Introduce a mangling for multiple opaque types within the declaration.
2022-01-07 15:45:38 -08:00
Doug Gregor
f89ff0485f Introduce a mangling for multiple opaque types within the declaration.
The `Qr` mangling is used to refer to the opaque type within the
declaration that produces the opaque type. When there are multiple
opaque types, e.g., due to structural or named opaque result types, it
does not specify which of the opaque type parameters it refers to.

Introduce a new mangling `QR INDEX` for opaque type parameters after
the first, retaining the `Qr` mangling for the first opaque type
parameter. This way, existing (non-structural) uses of opaque result
types retain the same manglings, but uses of structural or named
opaque result types (new features) will have distinct manglings.

Note that this mangling within a declaration is only used for the
declaration itself, and not for references to the opaque type of the
declaration, so there is no impact on the runtime demangler.
2022-01-07 10:43:45 -08:00
swift-ci
f63372b795 Merge remote-tracking branch 'origin/main' into rebranch 2022-01-06 01:13:44 -08:00
Pavel Yaskevich
d516281da9 [Distributed] NFC: Remove Method from accessor APIs
The API is not constrained to methods only, it should support
computed properties as well.
2021-12-23 14:10:05 -08:00
swift-ci
0757971701 Merge remote-tracking branch 'origin/main' into rebranch 2021-12-21 17:53:22 -08:00
Kuba (Brecka) Mracek
663a6fb771 Introduce SWIFT_STDLIB_HAS_TYPE_PRINTING flag to remove the ability to print types at runtime (to save codesize) (#40649) 2021-12-21 17:47:54 -08:00
swift-ci
134e17c8ec Merge remote-tracking branch 'origin/main' into rebranch 2021-12-17 16:54:09 -08:00
Pavel Yaskevich
8e1aa19188 [Mangling] Define mangling for runtime accessible function records 2021-12-17 10:52:56 -08:00
Pavel Yaskevich
b8358b26fe [Mangling] Add mangling for distributed method accessors
`Distributed Method Accessor` is a global helper function
to get access to particular `distributed method` on an actor
from outside the process.
2021-12-17 10:52:55 -08:00
swift-ci
ee96d2798c Merge remote-tracking branch 'origin/main' into rebranch 2021-11-30 08:33:02 -08:00
Saleem Abdulrasool
910fbee14e gardening: make c++98-compat-extra-semi an error
This cleans up 90 instances of this warning and reduces the build spew
when building on Linux.  This helps identify actual issues when
building which can get lost in the stream of warning messages.  It also
helps restore the ability to build the compiler with gcc.
2021-11-27 11:40:17 -08:00
swift-ci
6efbfb5c26 Merge remote-tracking branch 'origin/main' into rebranch 2021-11-18 17:54:19 -08:00
Mike Ash
4440bd4977 Merge pull request #40055 from mikeash/swift-inspect-dump-arrays
[swift-inspect] Add a command to dump information about allocated arrays in the target process.
2021-11-18 20:50:12 -05:00
swift-ci
aaa2b056d1 Merge remote-tracking branch 'origin/main' into rebranch 2021-11-18 08:33:49 -08:00
Alastair Houghton
8e56ff7da0 Merge pull request #39922 from al45tair/problem/84615816
[Tests][Demangling] Reduce maximum recursion depth for NodePrinter.
2021-11-18 16:21:50 +00:00
Ben Barham
25b1b2517e [rebranch] Replace LLVM_ATTRIBUTE_NORETURN with [[noreturn]]
llvm-project 09529892b518c8df8c24395e68e0a7a5e8bda5fb removed
`LLVM_ATTRIBUTE_NORETURN` in favour of the C++11 `[[noreturn]]`.
2021-11-18 16:49:28 +10:00
Robert Widmann
924d15b03f [NFC] Swap LLVM_NODISCARD for LLVM_ATTRIBUTE_NORETURN
These were originally meant to be no-return functions since they're going to abort. They were accidentally changed to no-discard functions despite not having a return value.
2021-11-17 13:17:37 -08:00
Mike Ash
9fa76e2f4f [swift-inspect] Add a command to dump information about allocated arrays in the target process. 2021-11-04 16:15:15 -04:00
Alastair Houghton
50c55ce4d9 [Tests][Demangling] Reduce maximum recursion depth for NodePrinter.
At MaxDepth 1024, NodePrinter will blow the stack on a debug build.
Reduce it to 768.

rdar://84615816
2021-10-26 17:12:14 +01:00
zoecarver
2546406de8 [cxx-interop][nfc] Remove internal header dependency on runtime/stdlib/shims.
The internal compiler headers should not include swift shim headers. Removing this dependency allows libSwift to import Swift compiler headers (otherwise, we get name conflics, because we import SwiftShims headers twice: from the source includes and build includes).
2021-10-25 14:56:45 -07:00
Doug Gregor
142973b653 Use a non-conflicting mangling for distributed thunks.
Distributed thunks were using the same mangling as direct method
reference thunks (i.e., for "super" calls). Although not technically
conflicting so long as actors never gain inheritance, it's confusing
and could cause problems in the future. So, introduce a distinct
mangling for distributed thunks and plumb them through the demangling
and remangler.
2021-10-15 23:15:43 -07:00
Kuba (Brecka) Mracek
557bf685be Don't include support for old mangling in runtimes without ObjC interop (#39675) 2021-10-13 19:47:05 -07:00
Alastair Houghton
5c00c7e0fa Merge pull request #39506 from al45tair/problem/82870372
[Remangler] Fix remangling in static bound generic function context
2021-10-02 09:26:24 +01:00
Kuba Mracek
d0e05003f5 For individual runtime records for types/protocols/conformances, add and use new mangling suffixes 2021-09-29 13:14:58 -07:00
Alastair Houghton
1ac9159a81 [Remangler] Fix remangling of items in static bound generic function context
If you had a type alias (for instance) with its context set to a static
bound generic function, the generic arguments were remangled in the wrong
place because Node::Kind::Static wasn't handled properly in a couple of
functions.  Fix that.

rdar://82870372
2021-09-29 14:27:31 +01:00
Alastair Houghton
8be084f30a Merge pull request #39187 from al45tair/problem/79725187
[Demangler] Improve remangler error handling
2021-09-27 17:03:49 +01:00
Kuba (Brecka) Mracek
80519fb7e2 Avoid using system isdigit in favor of swift::Mangle::isDigit (#39382) 2021-09-21 17:36:18 -07:00
Doug Gregor
7f2117690c Skip standard substitutions for _Concurrency types when back-deploying.
When back-deploying concurrency support, do not use the standard
substitutions for _Concurrency-defined types (such as `Task`) in type
metadata because older Swift runtimes will not be able to demangle
them. Instead, use the full mangled names so the runtime can still
demangle them appropriately.

Addresses rdar://82931890.
2021-09-09 13:23:19 -07:00
Alastair Houghton
59cfe356d5 [Demangling] Improve DEMANGLE_ASSERT, enable some disabled tests.
Defining DEMANGLE_ASSERT as assert() is simple but messes up the file/line
information from assert().  Make a dedicated assertion failure function and use
that instead to fix.

Also enable some tests that were disabled because they triggered abort()
calls in the remanglers.

rdar://79725187
2021-09-07 14:08:29 +01:00
Alastair Houghton
b8a879954a [Demangler] Tidy up a bit, and add line numbers to ManglingErrors.
Because DEMANGLER_ASSERT() might cause the remanglers to return a ManglingError
with the code ManglingError::AssertionFailed, it's useful to have a line number
in the ManglingError as well as the other information.  This is also potentially
helpful for other cases where the code is used multiple times in the remanglers.

rdar://79725187
2021-09-06 17:49:55 +01:00
Alastair Houghton
227b438963 [Demangling] Added DEMANGLER_ASSERT to replace assert() calls.
This returns an error code if we're in the runtime, rather than assert()ing.

rdar://79725187
2021-09-06 17:49:50 +01:00
Alastair Houghton
cc869b90b1 [Demangling] Remangling error handling for the OldRemangler.
First pass at adding error handling to the OldRemangler.  Still pondering
assert() calls.

rdar://79725187
2021-09-06 17:49:09 +01:00
Alastair Houghton
fbf082b6cb [Demangling] Make Demangle::getUnspecialized() return errors too.
This lets us completely remove the unreachable() function from Remangler.cpp.

rdar://79725187
2021-09-06 17:49:09 +01:00
Alastair Houghton
fc3322f9fc [Demangling] More remangler error handling.
First pass at adding error handling to the actual Remangler.  There are
still some assert() calls at this point that I'm thinking about.

rdar://79725187
2021-09-06 17:49:09 +01:00
Alastair Houghton
3f01f853a6 [Demangling] Add error handling to the remangler.
Mangling can fail, usually because the Node structure has been built
incorrectly or because something isn't supported with the old remangler.
We shouldn't just terminate the program when that happens, particularly
if it happens because someone has passed bad data to the demangler.

rdar://79725187
2021-09-06 17:49:09 +01:00
Alastair Houghton
e6ced29908 [Demangler] Fix incorrect assertions in OldRemangler and NodePrinter.
There can be, currently, up to eight child nodes for a FunctionType.
OldRemangler seemed to think there could only be three, while NodePrinter
plumped for six.

rdar://82252704
2021-08-27 11:24:19 +01:00
Alastair Houghton
4b2e31654e [Demangler][Tests] Re-add getObjcClassByMangledName test.
This was reverted in ec3ccd72 because it broke the iOS simulator build.
2021-08-17 09:46:21 +01:00
Mishal Shah
34350e45cd Revert "[Demangler][Tests] Add an explicit test for getObjCClassByMangledName." 2021-08-16 14:00:39 -07:00
Alastair Houghton
8db56f09a3 [Demangler][Tests] Add an explicit test for getObjCClassByMangledName.
Added a special test for getObjCClassByMangledName; this needs testing
separately as it uses the DecodedMetadataBuilder, which doesn't get exercised
by the normal demangling tests.

Added all the test cases from rdar://63485806, rdar://63488139, rdar://63496478,
rdar://63410196 and rdar://68449341.  The test cases from rdar://63485806 are
disabled for now because the problem there is the error handling mechanism (or
lack thereof), rather than us not handling errors.

Fixes the remaining cases from

rdar://63488139
rdar://63496478
2021-08-04 16:21:32 +01:00