|
19 | 19 | #include "swift/AST/Module.h" |
20 | 20 | #include "swift/Basic/Assertions.h" |
21 | 21 | #include "swift/Basic/LangOptions.h" |
| 22 | +#include "swift/Basic/PrettyStackTrace.h" |
22 | 23 | #include "swift/Parse/ParseVersion.h" |
23 | 24 | #include "swift/Serialization/SerializedModuleLoader.h" |
24 | 25 | #include "swift/Strings.h" |
@@ -697,23 +698,19 @@ std::string ModuleFileSharedCore::Dependency::getPrettyPrintedPath() const { |
697 | 698 | } |
698 | 699 |
|
699 | 700 | void ModuleFileSharedCore::fatal(llvm::Error error) const { |
700 | | - llvm::SmallString<0> errorStr; |
701 | | - llvm::raw_svector_ostream out(errorStr); |
702 | | - |
703 | | - out << "*** DESERIALIZATION FAILURE ***\n"; |
704 | | - out << "*** If any module named here was modified in the SDK, please delete the ***\n"; |
705 | | - out << "*** new swiftmodule files from the SDK and keep only swiftinterfaces. ***\n"; |
706 | | - outputDiagnosticInfo(out); |
707 | | - out << "\n"; |
708 | | - if (error) { |
709 | | - handleAllErrors(std::move(error), [&](const llvm::ErrorInfoBase &ei) { |
710 | | - ei.log(out); |
711 | | - out << "\n"; |
712 | | - }); |
713 | | - } |
714 | | - |
715 | | - llvm::PrettyStackTraceString trace(errorStr.c_str()); |
716 | | - abort(); |
| 701 | + abortWithPrettyStackTraceMessage([&](auto &out) { |
| 702 | + out << "*** DESERIALIZATION FAILURE ***\n"; |
| 703 | + out << "*** If any module named here was modified in the SDK, please delete the ***\n"; |
| 704 | + out << "*** new swiftmodule files from the SDK and keep only swiftinterfaces. ***\n"; |
| 705 | + outputDiagnosticInfo(out); |
| 706 | + out << "\n"; |
| 707 | + if (error) { |
| 708 | + handleAllErrors(std::move(error), [&](const llvm::ErrorInfoBase &ei) { |
| 709 | + ei.log(out); |
| 710 | + out << "\n"; |
| 711 | + }); |
| 712 | + } |
| 713 | + }); |
717 | 714 | } |
718 | 715 |
|
719 | 716 | void ModuleFileSharedCore::outputDiagnosticInfo(llvm::raw_ostream &os) const { |
|
0 commit comments