Skip to content

SILCombine: We are not guaranteed to get a function_ref instruction here #25014

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

Merged

Conversation

aschwaighofer
Copy link
Contributor

Also fix an issue in that cast optimizer and objc bridging thunks that
are marked dynamic.

Same test case tests both issues.

rdar://51068786

Also fix an issue in that cast optimizer and objc bridging thunks that
are marked dynamic.

Same test case tests both issues.

rdar://51068786
@aschwaighofer
Copy link
Contributor Author

@swift-ci Please test

@@ -271,7 +271,7 @@ CastOptimizer::optimizeBridgedObjCToSwiftCast(SILDynamicCastInst dynamicCast) {
// Now emit the a cast from the casted ObjC object into a target type.
// This is done by means of calling _forceBridgeFromObjectiveC or
// _conditionallyBridgeFromObjectiveC_bridgeable from the Target type.
auto *funcRef = Builder.createFunctionRef(Loc, bridgingFunc);
auto *funcRef = Builder.createFunctionRefFor(Loc, bridgingFunc);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createFunctionRefFor takes [dynamically_replacable] into account and generates either a function_ref or a dynamic_function_ref.

@aschwaighofer aschwaighofer merged commit 84a68e1 into swiftlang:master May 23, 2019
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.

1 participant