Add cxx_virtual_method instruction.#26658
Conversation
|
Hmm. I'm sad that we need |
|
Hi @jrose-apple, the context for needing cxx_virtual_method is here: https://forums.swift.org/t/c-interop-virtual-function-calls/27567/3 in case you missed it. |
|
I guess if we have a C++ abstraction pattern we can have a |
|
I'm just a simple bystander, but could you add some SILGen tests as well? |
7b846ff to
c468172
Compare
include/swift/SIL/SILInstruction.h
Outdated
There was a problem hiding this comment.
I wonder if there's a better way to have exactly two results than this. My SIL isn't strong enough. @gottesmm?
lib/IRGen/GenCall.cpp
Outdated
lib/SILGen/SILGenApply.cpp
Outdated
There was a problem hiding this comment.
When you do get to it, we'll need some way to indicate that the adjusted "this" pointer depends on the lifetime of the original object. I'm not sure if there's a way to do that other than the mark_dependence instruction, but there ought to be.
There was a problem hiding this comment.
My suggestion (going back to what I was saying above) is that the method should take self either forwarding or guaranteed.
gottesmm
left a comment
There was a problem hiding this comment.
Before you land this, I want to take another look through. But some initial comments.
lib/SIL/SILInstructions.cpp
Outdated
There was a problem hiding this comment.
This is the wrong semantics. The right semantics IMO are that this should be either forwarding or guaranteed.
lib/SILGen/SILGenApply.cpp
Outdated
There was a problem hiding this comment.
My suggestion (going back to what I was saying above) is that the method should take self either forwarding or guaranteed.
This also contains the code to trigger forming cxx_virtual_method instructions but the this pointer adjustment is not hooked up yet.
Companion pr: apple/swift-clang#349