ABI descriptors should always be emitted as sidecars for library-evolution-enabled modules.
However, generating these files requires traversing the entire module (like indexing), which may
hit additional deserialization issues. To unblock builds, this patch introduces a flag to skip
the traversing logic so that we emit an empty ABI descriptor file. The empty file serves as
a placeholder so that build system doesn't need to know the details.
Emitted at the emit-module step, ABI descriptor is of an entensible JSON format. This patch sets
up a segment in the file to also keep track of all compile-time constant values for other tools
to consume. As the initial step, we only keep track of string literals in the source files.
The RequirementSignature generalizes the old ArrayRef<Requirement>
which stores the minimal requirements that a conforming type's
witnesses must satisfy, to also record the protocol typealiases
defined in the protocol.
The first generic parameter of an `OpaqueTypeDecl` was still being used
as the "underlying" interface type of the opaque type, which is
incorrect for both structural and named opaque result types. Eliminate
this notion, because the (declared) interface type already has the
correct structure.
Only ABI checking depended on the old "underlying" type, so rework it to
instead substitute into properly for structural opaque result types as
well.
Deserialization required a small adjustment to eliminate a cycle
because the interface type of an `OpaqueTypeDecl` involves opaque
archetype types, which reference the declaration itself... so
deserialize the interface type later, now that it's correct.
Instead of checking that the stdlib can be loaded in a variety of places, check it when setting up the compiler instance. This required a couple more checks to avoid loading the stdlib in cases where it’s not needed.
To be able to differentiate stdlib loading failures from other setup errors, make `CompilerInstance::setup` return an error message on failure via an inout parameter. Consume that error on the call side, replacing a previous, more generic error message, adding error handling where appropriate or ignoring the error message, depending on the context.
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.
Previously, we use USR as a delegate for mangled name. However, USR won't incorporate name changes made
by attributes like @_silgen_name. Instead, we should add a dedicated field for canonical mangled names.
rdar://84202064
Previously, we use USR as a delegate for mangled name. However, USR won't incorporate name changes made
by attributes like @_silgen_name. Instead, we should add a dedicated field for canonical mangled names.
rdar://84202064
The API digester forces loading the stdlib which may pick up an stdlib
from a different SDK than the one being tested. Disable the check
enforcing loading only swiftmodules built for the same SDK.
Remove the canonicalVararg parameter and
CanParamArrayRef wrapper. Almost none of the
callers want canonicalVararg, and the one that
does calls `getCanonicalType` on the result
anyway.
Moving generic constraint from extension to its member or vice versa may change the mangled name
of the member without changing the generic signature, thus introducing ABI breakages. This change
teaches the ABI checker to diagnose USR (mangled name) changes to cover such cases.
rdar://78276290
Before this change, the ABI checker didn't complain about missing @available
attributes on new APIs if the enclosing scopes of new APIs have
availability information. Instead, we should require explicit @available attributes
for new APIs to prevent them inheriting wrong availability information from a
preexisting scope.
rdar://81719628