Allow one to separately specify the ABI name of a module.

Introduce a new compiler flag `-module-abi-name <name>` that uses the
given name as the ABI name for the module (rather than the module's
name in source code). The ABI name impacts name mangling and metadata.
This commit is contained in:
Doug Gregor
2021-03-11 11:36:10 -08:00
parent 6f4f9f8c0f
commit 2a28fed34d
22 changed files with 111 additions and 7 deletions

View File

@@ -723,6 +723,8 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
M.setImplicitDynamicEnabled();
if (loadedModuleFile->hasIncrementalInfo())
M.setHasIncrementalInfo();
if (!loadedModuleFile->getModuleABIName().empty())
M.setABIName(Ctx.getIdentifier(loadedModuleFile->getModuleABIName()));
auto diagLocOrInvalid = diagLoc.getValueOr(SourceLoc());
loadInfo.status = loadedModuleFile->associateWithFileContext(