Commit Graph

14 Commits

Author SHA1 Message Date
Anthony Latsis
17fc00f8a7 [test] IRGen: Adjust FileCheck patterns for new nuw attribute in upstream LLVM
This attribute was introduced in
7eca38ce76d5d1915f4ab7e665964062c0b37697 (llvm-project).

Match it using a wildcard regex, since it is not relevant to these
tests.

This is intended to reduce future conflicts with rebranch.
2025-05-04 03:28:56 +01:00
Arnold Schwaighofer
599e82c933 Fix more test/IRGen test cases 2023-06-21 10:10:40 -07:00
Slava Pestov
46fbf8c123 IRGen: Consistently mangle 'associated type paths' without a generic signature
Mangling uses a generic signature is used to shorten member types
to just a name where the protocol is unambiguous.

Unfortunately, in the particular case of 'associated type paths',
the IRGen mangler did not consistently set the right signature.

Sometimes, it would use no signature, and other times it would use
the signature of the concrete conforming type, which is incorrect
because the member type is written relative to the root protocol's
generic signature, <Self : P>.

This was caught by some new assertions I'm adding to the rewrite
system.

Note that this changes the mangling of a few symbols, but none
are public in the ABI.
2021-07-07 23:25:58 -04:00
Doug Gregor
e52a8838bb [IRGen] Enabled mangled inherited conformances for conditional conformances.
Now that the runtime fills in the private slots with conditional requirement
information, we can always use mangled names for inherited conformances.

Fixes rdar://problem/46282080.
2018-11-29 17:05:05 -08:00
Doug Gregor
81909f24ff [IRGen] Update IRGen test cases for swift_getWitnessTable(). 2018-10-25 20:35:27 -07:00
Doug Gregor
d627d5b6de Update test cases for mangled associated type witnesses. 2018-09-26 23:19:33 -07:00
Erik Eckstein
39bb14b094 change mangling prefix from $S to $s
This is the final ABI mangling prefix

rdar://problem/38471478
2018-09-19 13:55:11 -07:00
Doug Gregor
6948073499 [IRGen] Simplify nondependent associated type witness metadata accessors.
When we’re creating an associated type witness metadata accessor for
resilience reasons, but the associated type witness doesn’t involve any
type parameters, directly form the type metadata reference (and don’t
cache it).

While here… update all of the IRGen/SILGen test cases perturbed by the
introduction of resilient associated type access patterns.
2018-09-14 20:59:03 -07:00
John McCall
31f2eec044 Change type metadata accessors to support incomplete metadata.
This includes global generic and non-generic global access
functions, protocol associated type access functions,
swift_getGenericMetadata, and generic type completion functions.

The main part of this change is that the functions now need to take
a MetadataRequest and return a MetadataResponse, which is capable
of expressing that the request can fail.  The state of the returned
metadata is reported as an second, independent return value; this
allows the caller to easily check the possibility of failure without
having to mask it out from the returned metadata pointer, as well
as allowing it to be easily ignored.

Also, change metadata access functions to use swiftcc to ensure that
this return value is indeed returned in two separate registers.

Also, change protocol associated conformance access functions to use
swiftcc.  This isn't really related, but for some reason it snuck in.
Since it's clearly the right thing to do, and since I really didn't
want to retroactively tease that back out from all the rest of the
test changes, I've left it in.

Also, change generic metadata access functions to either pass all
the generic arguments directly or pass them all indirectly.  I don't
know how we ended up with the hybrid approach.  I needed to change all
the code-generation and calls here anyway in order to pass the request
parameter, and I figured I might as well change the ABI to something
sensible.
2018-03-18 21:38:08 -04:00
Huon Wilson
ce1bb8b13c [IRGen] Cond. conformance witness table count isn't needed dynamically.
The count of the number of witness tables was designed to be an
assertion/check that we've hooked up all the infrastructure
correctly. Everything is now implemented, and the assertion has never
triggered, so it can be removed, saving some work.

Fixes rdar://problem/38038928.
2018-03-06 00:22:05 +11:00
Doug Gregor
40283f9b73 [ABI] Add the protocol conformance descriptor into a witness table.
Extend witness tables with a pointer to the protocol conformance
descriptor from which the witness table was generated. This will allow
us to determine (for example) whether two witness tables were
generated from the same (or equivalent) conformances in the future, as
well as discover more information about the witness table itself.

Fixes rdar://problem/36287959.
2018-01-18 17:13:13 -08:00
Erik Eckstein
cd3d50a5d9 ABI: Change the mangling prefix from _T0 to $S 2018-01-06 13:55:59 -08:00
Doug Gregor
9b9923bd2e [IRGen] Bind conditional requirements in generic witness table instantiation function.
A witness table instantiation function can end up referring to
conditional requirements to, e.g., fill in base witness tables. Store
the conditional requirements first, and also bind the witness tables
for conditional requirements within the local scope so they can be
used directly. Fixes SR-6478.
2017-11-27 17:24:05 -08:00
Doug Gregor
8329616e31 [IRGen] Bind conditional requirements for witness table accessors.
When emitting a witness table accessor (e.g., an associated type metadata
or associated type conformance accessor) for a conditional conformance,
bind the conditional requirements so we can refer to them within that
accessor. Witness methods get this behavior already through the SelfWitnessTable parameter, but everything the witness table needs it.

Fixes most of SR-6478.
2017-11-27 17:24:05 -08:00