Frontend: add a frontend flag to generate empty ABI descriptors to workaround deserialization issues

ABI descriptors should always be emitted as sidecars for library-evolution-enabled modules.
However, generating these files requires traversing the entire module (like indexing), which may
hit additional deserialization issues. To unblock builds, this patch introduces a flag to skip
the traversing logic so that we emit an empty ABI descriptor file. The empty file serves as
a placeholder so that build system doesn't need to know the details.
This commit is contained in:
Xi Ge
2022-02-23 21:51:03 -08:00
parent a9a512de37
commit e1aaee4fec
9 changed files with 32 additions and 9 deletions

View File

@@ -158,7 +158,8 @@ SerializationOptions CompilerInvocation::computeSerializationOptions(
getIRGenOptions().PublicLinkLibraries;
serializationOpts.SDKName = getLangOptions().SDKName;
serializationOpts.ABIDescriptorPath = outs.ABIDescriptorOutputPath.c_str();
serializationOpts.emptyABIDescriptor = opts.emptyABIDescriptor;
if (!getIRGenOptions().ForceLoadSymbolName.empty())
serializationOpts.AutolinkForceLoad = true;