mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Add all deserialization fatal output to the pretty stack trace
Rather than outputting diagnostics and to stderr, output all the extra
information added when deserialization fatally fails to the pretty stack
trace instead. Since the pretty stack trace is added to crash logs, this
should avoid the dance of requesting the compiler output
- Moves the previous "**** DESERIALIZATION FAILURE ..." output to the
last pretty stack trace line
- Removes the module and compiler version notes added to the fatal
diagnostic
- Adds a new effective compiler version line for all frontend failure.
Somewhat duplicates the line from the driver, but adds in the
effective version
- Adds a new line for the full misc version of the module that failed.
May double up with previous "While reading from ..." lines that are
added in various deserialization methods, but better to have it
twice than not at all
This commit is contained in:
@@ -371,12 +371,12 @@ private:
|
||||
|
||||
/// Emits one last diagnostic, logs the error, and then aborts for the stack
|
||||
/// trace.
|
||||
LLVM_ATTRIBUTE_NORETURN static void fatal(llvm::Error error);
|
||||
void fatalIfNotSuccess(llvm::Error error) {
|
||||
LLVM_ATTRIBUTE_NORETURN void fatal(llvm::Error error) const;
|
||||
void fatalIfNotSuccess(llvm::Error error) const {
|
||||
if (error)
|
||||
fatal(std::move(error));
|
||||
}
|
||||
template <typename T> T fatalIfUnexpected(llvm::Expected<T> expected) {
|
||||
template <typename T> T fatalIfUnexpected(llvm::Expected<T> expected) const {
|
||||
if (expected)
|
||||
return std::move(expected.get());
|
||||
fatal(expected.takeError());
|
||||
@@ -508,6 +508,9 @@ public:
|
||||
return info;
|
||||
}
|
||||
|
||||
/// Outputs information useful for diagnostics to \p out
|
||||
void outputDiagnosticInfo(llvm::raw_ostream &os) const;
|
||||
|
||||
// Out of line to avoid instantiation OnDiskChainedHashTable here.
|
||||
~ModuleFileSharedCore();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user