mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Implement LLVM IR Virtual Function Elimination for Swift classes. (#39128)
- Virtual calls are done via a @llvm.type.checked.load instrinsic call with a type identifier - Type identifier of a vfunc is the base method's mangling - Type descriptors and class metadata get !type markers that list offsets and type identifiers of all vfuncs - The -enable-llvm-vfe frontend flag enables VFE - Two added tests verify the behavior on IR and by executing a program
This commit is contained in:
committed by
GitHub
parent
276d8c2074
commit
5412ed1936
@@ -1896,6 +1896,10 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
Opts.EnableGlobalISel = true;
|
||||
}
|
||||
|
||||
if (Args.hasArg(OPT_enable_llvm_vfe)) {
|
||||
Opts.VirtualFunctionElimination = true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user