Adapt to llvm.org StringRef API change

This commit is contained in:
Fred Riss
2020-01-31 15:31:50 -08:00
committed by Michael Forster
parent 710799dd09
commit 259d78a350
99 changed files with 346 additions and 327 deletions

View File

@@ -137,7 +137,7 @@ public:
llvm::raw_svector_ostream OS(Buf);
auto TargetNTD = Target.getBaseNominal();
if (!SwiftLangSupport::printUSR(TargetNTD, OS)) {
TargetUSR = OS.str();
TargetUSR = std::string(OS.str());
}
}
@@ -336,7 +336,7 @@ static bool getModuleInterfaceInfo(ASTContext &Ctx,
Printer, Options,
Group.hasValue() && SynthesizedExtensions);
Info.Text = OS.str();
Info.Text = std::string(OS.str());
return false;
}
@@ -356,7 +356,7 @@ static bool getHeaderInterfaceInfo(ASTContext &Ctx,
AnnotatingPrinter Printer(Info, OS);
printHeaderInterface(HeaderName, Ctx, Printer, Options);
Info.Text = OS.str();
Info.Text = std::string(OS.str());
return false;
}
@@ -367,9 +367,9 @@ SwiftInterfaceGenContext::createForSwiftSource(StringRef DocumentName,
CompilerInvocation Invocation,
std::string &ErrMsg) {
SwiftInterfaceGenContextRef IFaceGenCtx{ new SwiftInterfaceGenContext() };
IFaceGenCtx->Impl.DocumentName = DocumentName;
IFaceGenCtx->Impl.DocumentName = DocumentName.str();
IFaceGenCtx->Impl.IsModule = true;
IFaceGenCtx->Impl.ModuleOrHeaderName = SourceFileName;
IFaceGenCtx->Impl.ModuleOrHeaderName = SourceFileName.str();
IFaceGenCtx->Impl.AstUnit = AstUnit;
PrintOptions Options = PrintOptions::printSwiftFileInterface();
@@ -377,7 +377,7 @@ SwiftInterfaceGenContext::createForSwiftSource(StringRef DocumentName,
llvm::raw_svector_ostream OS(Text);
AnnotatingPrinter Printer(IFaceGenCtx->Impl.Info, OS);
printSwiftSourceInterface(AstUnit->getPrimarySourceFile(), Printer, Options);
IFaceGenCtx->Impl.Info.Text = OS.str();
IFaceGenCtx->Impl.Info.Text = std::string(OS.str());
if (makeParserAST(IFaceGenCtx->Impl.TextCI, IFaceGenCtx->Impl.Info.Text,
Invocation)) {
ErrMsg = "Error during syntactic parsing";
@@ -396,9 +396,9 @@ SwiftInterfaceGenContext::create(StringRef DocumentName,
bool SynthesizedExtensions,
Optional<StringRef> InterestedUSR) {
SwiftInterfaceGenContextRef IFaceGenCtx{ new SwiftInterfaceGenContext() };
IFaceGenCtx->Impl.DocumentName = DocumentName;
IFaceGenCtx->Impl.DocumentName = DocumentName.str();
IFaceGenCtx->Impl.IsModule = IsModule;
IFaceGenCtx->Impl.ModuleOrHeaderName = ModuleOrHeaderName;
IFaceGenCtx->Impl.ModuleOrHeaderName = ModuleOrHeaderName.str();
IFaceGenCtx->Impl.Invocation = Invocation;
CompilerInstance &CI = IFaceGenCtx->Impl.Instance;
@@ -457,7 +457,7 @@ SwiftInterfaceGenContext::createForTypeInterface(CompilerInvocation Invocation,
std::string &ErrorMsg) {
SwiftInterfaceGenContextRef IFaceGenCtx{ new SwiftInterfaceGenContext() };
IFaceGenCtx->Impl.IsModule = false;
IFaceGenCtx->Impl.ModuleOrHeaderName = TypeUSR;
IFaceGenCtx->Impl.ModuleOrHeaderName = TypeUSR.str();
IFaceGenCtx->Impl.Invocation = Invocation;
CompilerInstance &CI = IFaceGenCtx->Impl.Instance;
SourceTextInfo &Info = IFaceGenCtx->Impl.Info;
@@ -491,7 +491,7 @@ SwiftInterfaceGenContext::createForTypeInterface(CompilerInvocation Invocation,
if (ide::printTypeInterface(Module, TypeUSR, Printer,
IFaceGenCtx->Impl.DocumentName, ErrorMsg))
return nullptr;
IFaceGenCtx->Impl.Info.Text = OS.str();
IFaceGenCtx->Impl.Info.Text = std::string(OS.str());
if (makeParserAST(IFaceGenCtx->Impl.TextCI, IFaceGenCtx->Impl.Info.Text,
Invocation)) {
ErrorMsg = "Error during syntactic parsing";