Merge pull request #30403 from MForster/forster/string-fixes

Cherry-pick StringRef->std::string conversion fixes into `master`
This commit is contained in:
Dmitri Gribenko
2020-03-17 12:09:36 +01:00
committed by GitHub
107 changed files with 363 additions and 344 deletions

View File

@@ -274,7 +274,7 @@ static void initDocGenericParams(const Decl *D, DocEntityInfo &Info) {
if (GP->getDecl()->isImplicit())
continue;
DocGenericParam Param;
Param.Name = GP->getName().str();
Param.Name = std::string(GP->getName());
Info.GenericParams.push_back(Param);
}
@@ -959,7 +959,7 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx, StringRef ModuleName,
AnnotatingPrinter Printer(OS);
printModuleInterface(M, None, TraversalOptions, Printer, Options,
true);
Info.Text = OS.str();
Info.Text = std::string(OS.str());
Info.TopEntities = std::move(Printer.TopEntities);
Info.References = std::move(Printer.References);
return false;
@@ -1080,7 +1080,7 @@ static bool getSourceTextInfo(CompilerInstance &CI,
Walker.walk(*CI.getMainModule());
CharSourceRange FullRange = SM.getRangeForBuffer(BufID);
Info.Text = SM.extractText(FullRange);
Info.Text = SM.extractText(FullRange).str();
Info.TopEntities = std::move(Walker.TopEntities);
Info.References = std::move(Walker.References);
return false;
@@ -1168,8 +1168,8 @@ public:
R.StartLine, R.StartColumn, R.EndLine, R.EndColumn,
R.ArgIndex
}; });
return {Start.first, Start.second, End.first, End.second, R.Text,
std::move(SubRanges)};
return {Start.first, Start.second, End.first,
End.second, R.Text.str(), std::move(SubRanges)};
});
unsigned End = AllEdits.size();
StartEnds.emplace_back(Start, End);