mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Turn on +0 self by default.
The only caveat is that: 1. We do not properly recognize when we have a let binding and we perform a guaranteed dynamic call. In such a case, we add an extra retain, release pair around the call. In order to get that case I will need to refactor some code in Callee. I want to make this change, but not at the expense of getting the rest of this work in. 2. Some of the protocol witness thunks generated have unnecessary retains or releases in a similar manner. But this is a good first step. I am going to send a large follow up email with all of the relevant results, so I can let the bots chew on this a little bit. rdar://19933044 Swift SVN r27241
This commit is contained in:
@@ -90,7 +90,7 @@ public:
|
||||
bool EnableFuncSigOpts = true;
|
||||
|
||||
/// Should we emit self as a guaranteed parameter?
|
||||
bool EnableGuaranteedSelf = false;
|
||||
bool EnableGuaranteedSelf = true;
|
||||
|
||||
/// Instrument code to generate profiling information.
|
||||
bool GenerateProfile = false;
|
||||
|
||||
@@ -2718,7 +2718,21 @@ public:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool hasGuaranteedSelfParam() const {
|
||||
switch (getRepresentation()) {
|
||||
case Representation::Thick:
|
||||
case Representation::Block:
|
||||
case Representation::Thin:
|
||||
case Representation::CFunctionPointer:
|
||||
case Representation::ObjCMethod:
|
||||
return false;
|
||||
case Representation::Method:
|
||||
case Representation::WitnessMethod:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/// True if the function representation carries context.
|
||||
bool hasContext() const {
|
||||
switch (getRepresentation()) {
|
||||
|
||||
Reference in New Issue
Block a user