File tree Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Expand file tree Collapse file tree 3 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -1381,8 +1381,7 @@ static llvm::Expected<ParsedExpression> ParseAndImport(
1381
1381
1382
1382
if (expr_diagnostics.HasErrors ())
1383
1383
return make_error<ModuleImportError>(
1384
- expr_diagnostics.GetAllErrors ().AsCString (
1385
- " Explicit module import error" ));
1384
+ llvm::toString (expr_diagnostics.GetAllErrors ()));
1386
1385
1387
1386
std::unique_ptr<SwiftASTManipulator> code_manipulator;
1388
1387
if (repl || !playground) {
Original file line number Diff line number Diff line change @@ -937,14 +937,12 @@ bool SwiftASTContext::ScopedDiagnostics::HasErrors() const {
937
937
return false ;
938
938
}
939
939
940
- Status SwiftASTContext::ScopedDiagnostics::GetAllErrors () const {
940
+ llvm::Error SwiftASTContext::ScopedDiagnostics::GetAllErrors () const {
941
941
// Retrieve the error message from the DiagnosticConsumer.
942
942
DiagnosticManager diagnostic_manager;
943
943
PrintDiagnostics (diagnostic_manager);
944
-
945
- Status error;
946
- error.SetErrorString (diagnostic_manager.GetString ());
947
- return error;
944
+ return llvm::make_error<llvm::StringError>(diagnostic_manager.GetString (),
945
+ llvm::inconvertibleErrorCode ());
948
946
}
949
947
950
948
SwiftASTContext::ScopedDiagnostics::~ScopedDiagnostics () {
Original file line number Diff line number Diff line change @@ -484,7 +484,7 @@ class SwiftASTContext : public TypeSystemSwift {
484
484
bool HasErrors () const ;
485
485
// / Return all errors and warnings that happened during the lifetime of this
486
486
// / object.
487
- Status GetAllErrors () const ;
487
+ llvm::Error GetAllErrors () const ;
488
488
};
489
489
std::unique_ptr<ScopedDiagnostics> getScopedDiagnosticConsumer ();
490
490
// / \}
You can’t perform that action at this time.
0 commit comments