Calling C++ constructors -- looking for feedback on my approach

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()

Draft patch here

(I think you probably had something like this in mind?)

Pros

  • Changes relatively little code.

Cons

  • Breaks the idea that a Signature can be computed solely from a CanSILFunctionType.

  • Some getSignature() callsites now pass a clang::FunctionDecl, some don't. We need to make sure we do this everywhere it's relevant. Could be brittle as future getSignature() callsites might forget to do this. We could reduce the risk by making the clangFunc parameter non-optional and requiring callers to pass an explicit nullptr if it's not relevant.

Option 2: Plumb CXXConstructorDecl through FunctionType and SILFunctionType

Draft patch here

Pros

  • Signature can still be computed solely from a CanSILFunctionType.

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?