Skip to content

Optimizer: move optimizer bridging code from PassManager.cpp into its own file #80113

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 11 commits into from

Conversation

eeckstein
Copy link
Contributor

The bridging code was in PassManager.cpp only for historical reasons. It's now in OptimizerBridging.cpp.

NFC

slavapestov and others added 8 commits March 18, 2025 19:38
If any of the get*() methods are called on the wrong kind of
ProtocolConformanceRef, we immediately cast a pointer to an
incorrect type, which will most likely cause a crash.
The "abstract conformance is just a ProtocolDecl" assumption is pretty
fundamental here, so we have to fudge a bit at the API boundary for now.

Eventually, LocalTypeDataKind should just contain a ProtocolConformanceRef
instead of duplicating the representation, however this would require
fixing various calls to LocalTypeDataKind::forAbstractProtocolWitnessTable()
which pass in a ProtocolDecl to pass in a ProtocolConformanceRef instead.
…eWitness

The Protocol field isn't really necessary, because the conformance
stores the protocol. But we do need the substituted subject type
of the requirement, just temporarily, until an abstract conformance
stores its own subject type too.
This reverts the problematic parts of
fcbebc5 which had caused a lot of
unintended fallout, while preserving the actual feature supported by
the patch.

Before that patch (fcbeb), and after this one, we don't emit members
of specialized bound generic types, because these can be reconstructed
by substituting the "template parameters" in the unspecialized
type. This patch carves out an exception for inline arrays, because
DWARF has special support for arrays, which allows debuggers to reason
about them without needing special support.

rdar://146326633
… own file.

The bridging code was in PassManager.cpp only for historical reasons.
It's now in OptimizerBridging.cpp.

NFC
@eeckstein
Copy link
Contributor Author

@swift-ci smoke test

slavapestov and others added 3 commits March 19, 2025 07:15
…ormance

Fix a few more callers of ProtocolConformanceRef::forAbstract() to pass in a subject type
[Debug Info] Do not emit children of bound generic types
…bridging

Optimizer: move optimizer bridging code from `PassManager.cpp` into its own file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants