@@ -425,13 +425,13 @@ static void addModuleDependencies(ArrayRef<ModuleDecl::ImportedModule> imports,
425
425
case FileUnitKind::ClangModule: {
426
426
auto *LFU = cast<LoadedFile>(FU);
427
427
if (auto F = fileMgr.getFile (LFU->getFilename ())) {
428
- std::string moduleName = mod->getNameStr (). str ();
428
+ StringRef moduleName = mod->getNameStr ();
429
429
bool withoutUnitName = true ;
430
430
if (FU->getKind () == FileUnitKind::ClangModule) {
431
431
withoutUnitName = false ;
432
432
auto clangModUnit = cast<ClangModuleUnit>(LFU);
433
433
if (auto clangMod = clangModUnit->getUnderlyingClangModule ()) {
434
- moduleName = clangMod->getTopLevelModuleName (). str () ;
434
+ moduleName = clangMod->getTopLevelModuleName ();
435
435
// FIXME: clang's -Rremarks do not seem to go through Swift's
436
436
// diagnostic emitter.
437
437
clang::index::emitIndexDataForModuleFile (clangMod,
@@ -482,7 +482,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
482
482
StringRef filename = module ->getModuleFilename ();
483
483
// If this is a cross-import overlay, make sure we use the name of the
484
484
// underlying module instead.
485
- std::string moduleName = getUnderlyingModuleName (module , initialFile);
485
+ std::string moduleName = getUnderlyingModuleName (module , initialFile). str () ;
486
486
487
487
std::string error;
488
488
auto isUptodateOpt = parentUnitWriter.isUnitUpToDateForOutputFile (/* FilePath=*/ filename,
0 commit comments