Skip to content

Commit 4a7c8b3

Browse files
authored
Merge pull request #30678 from nathawes/master-next-failure-indexrecord
[Index] Make StringRef -> std::string conversions explicit.
2 parents 85762c3 + d865b52 commit 4a7c8b3

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/Index/IndexRecord.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -425,13 +425,13 @@ static void addModuleDependencies(ArrayRef<ModuleDecl::ImportedModule> imports,
425425
case FileUnitKind::ClangModule: {
426426
auto *LFU = cast<LoadedFile>(FU);
427427
if (auto F = fileMgr.getFile(LFU->getFilename())) {
428-
std::string moduleName = mod->getNameStr().str();
428+
StringRef moduleName = mod->getNameStr();
429429
bool withoutUnitName = true;
430430
if (FU->getKind() == FileUnitKind::ClangModule) {
431431
withoutUnitName = false;
432432
auto clangModUnit = cast<ClangModuleUnit>(LFU);
433433
if (auto clangMod = clangModUnit->getUnderlyingClangModule()) {
434-
moduleName = clangMod->getTopLevelModuleName().str();
434+
moduleName = clangMod->getTopLevelModuleName();
435435
// FIXME: clang's -Rremarks do not seem to go through Swift's
436436
// diagnostic emitter.
437437
clang::index::emitIndexDataForModuleFile(clangMod,
@@ -482,7 +482,7 @@ emitDataForSwiftSerializedModule(ModuleDecl *module,
482482
StringRef filename = module->getModuleFilename();
483483
// If this is a cross-import overlay, make sure we use the name of the
484484
// underlying module instead.
485-
std::string moduleName = getUnderlyingModuleName(module, initialFile);
485+
std::string moduleName = getUnderlyingModuleName(module, initialFile).str();
486486

487487
std::string error;
488488
auto isUptodateOpt = parentUnitWriter.isUnitUpToDateForOutputFile(/*FilePath=*/filename,

0 commit comments

Comments
 (0)