mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
IRGen: force lazy metadata initialization for PE/COFF
The metadata reference to the pre-exsting VWT cannot be supported on PE/COFF due to the direct reference to a value in an external module that is in static data (the model requires indirecting through memory). Always force the lazy initialization for the metadata on such platforms. This requires a secondary change - to initialize the VWT as well. This is ideally moved into the runtime where we can do this uniformly.
This commit is contained in:
@@ -1060,6 +1060,10 @@ static bool ParseIRGenArgs(IRGenOptions &Opts, ArgList &Args,
|
||||
Opts.EnableResilienceBypass = true;
|
||||
}
|
||||
|
||||
// PE/COFF cannot deal with the cross-module reference to the metadata parent
|
||||
// (e.g. NativeObject). Force the lazy initialization of the VWT always.
|
||||
Opts.LazyInitializeClassMetadata = Triple.isOSBinFormatCOFF();
|
||||
|
||||
if (const Arg *A = Args.getLastArg(OPT_read_type_info_path_EQ)) {
|
||||
Opts.ReadTypeInfoPath = A->getValue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user