Generate method/property @encodings from the foreign

SILFunctionType of the method instead of its formal type.

Gives more accurate information to the @encoding, makes
foreign error conventions work implicitly, and allows
IRGen's Swift-to-Clang to avoid duplicating arbitrary
amounts of the bridging logic from SILGen.

Some finagling was required in order to avoid calling
getConstantFunctionType from within other kinds of
lowering, which might have re-entered a generic context.

Also required fixing a bug with the type lowering of
optional DynamicSelfTypes where we would end up with
a substituted type in the lowered type.

Also, for some reason, our @encoding for -dealloc
methods was pretending that there was a formal parameter.
There didn't seem to be any justification for this,
and it's not like Clang does that.  Fixed.

Swift SVN r29266
This commit is contained in:
John McCall
2015-06-03 02:33:38 +00:00
parent d4986aab50
commit ed68d261e7
16 changed files with 347 additions and 275 deletions

View File

@@ -1536,7 +1536,7 @@ namespace {
outs << 'T';
std::string typeEnc;
getObjCEncodingForPropertyType(IGM, propTy, typeEnc);
getObjCEncodingForPropertyType(IGM, prop, typeEnc);
outs << typeEnc;
// Emit other attributes.