[cxx-interop] Add SIL function representation cxx_method; Support extending C++ types.

There are three major changes here:
    1. The addition of "SILFunctionTypeRepresentation::CXXMethod".
    2. C++ methods are imported with their members *last*. Then the arguments are switched when emitting the IR for an application of the function.
    3. Clang decls are now marked as foreign witnesses.

These are all steps towards being able to have C++ protocol conformance.
This commit is contained in:
zoecarver
2022-01-04 16:15:04 -08:00
parent 2928459383
commit 036361d1e4
37 changed files with 370 additions and 102 deletions

View File

@@ -269,12 +269,13 @@ enum class SILFunctionTypeRepresentation : uint8_t {
Block,
Thin,
CFunctionPointer,
FirstSIL = 8,
Method = FirstSIL,
ObjCMethod,
WitnessMethod,
Closure,
CXXMethod,
};
using SILFunctionTypeRepresentationField = BCFixed<4>;