Sorry, I got sidetracked into some other work, and I'm only now getting back to this.
I've explored how to get the CXXConstructorDecl plumbed through to the SignatureExpansion. I see two main options, for which I have draft patches based on my PR linked above; I'd like some feedback before proceeding further.
I'll also need to expose the arrangeCXXConstructorCall in Clang; a draft patch for that is here.
Option 1 (my preference): Plumb clang::FunctionDecl through IRGenModule::getSignature()
(I think you probably had something like this in mind?)
Pros
- Changes relatively little code.
Cons
-
Breaks the idea that a
Signaturecan be computed solely from aCanSILFunctionType. -
Some
getSignature()callsites now pass aclang::FunctionDecl, some don't. We need to make sure we do this everywhere it's relevant. Could be brittle as futuregetSignature()callsites might forget to do this. We could reduce the risk by making theclangFuncparameter non-optional and requiring callers to pass an explicitnullptrif it's not relevant.
Option 2: Plumb CXXConstructorDecl through FunctionType and SILFunctionType
Pros
Signaturecan still be computed solely from aCanSILFunctionType.
Cons
-
What's a decl doing inside a type? Ewwww.
-
Changes much more code.
-
How does this affect SIL serialization? (I'm very hazy on this topic.) Is it even possible to serialize/deserialize the
CXXConstructorDecl?