[ClangImporter] Avoid unneeded copy for getExportedModuleName

std::string -> StringRef of long-lived backing storage.

No functionality change.
This commit is contained in:
Jordan Rose
2019-03-21 11:46:06 -07:00
parent bfc2753976
commit 61d3b0d4ec
4 changed files with 4 additions and 6 deletions

View File

@@ -1847,11 +1847,9 @@ void ModuleFile::loadExtensions(NominalTypeDecl *nominal) {
// If the originating module is a private module whose interface is
// re-exported via public module, check the name of the public module.
std::string exportedModuleName;
if (auto clangModuleUnit =
dyn_cast<ClangModuleUnit>(parentModule->getFiles().front())) {
exportedModuleName = clangModuleUnit->getExportedModuleName();
moduleName = exportedModuleName;
moduleName = clangModuleUnit->getExportedModuleName();
}
for (auto item : *iter) {