mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SILGen: Use super_method for native non-final methods in classes
Use the `super_method` instruction for non-final `func` and `class func` declarations in native Swift classes. Previously, we would always emit a static `function_ref` for these, which prevents resilient dynamic dispatch. This is hidden behind a -use-native-super-dispatch flag while I survey the effects on devirtualization and stack promotion. When that's figured out, I'll add more tests and update test cases that still assume static dispatch. rdar://problem/22749732
This commit is contained in:
@@ -1002,6 +1002,8 @@ static bool ParseSILArgs(SILOptions &Opts, ArgList &Args,
|
||||
|
||||
Opts.GenerateProfile |= Args.hasArg(OPT_profile_generate);
|
||||
Opts.EmitProfileCoverageMapping |= Args.hasArg(OPT_profile_coverage_mapping);
|
||||
Opts.UseNativeSuperMethod |=
|
||||
Args.hasArg(OPT_use_native_super_method);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user