mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Add filenames to stack traces (#5623)
To make it easier to identify crashing files when testing multiple.
```
(elided)
3. Check::Context
filename: duplicate_name_same_line.carbon
NodeStack:
(elided)
```
This commit is contained in:
@@ -845,6 +845,9 @@ auto CompilationUnit::GetParseTreeAndSubtrees()
|
||||
auto CompilationUnit::LogCall(llvm::StringLiteral logging_label,
|
||||
llvm::StringLiteral timing_label,
|
||||
llvm::function_ref<auto()->void> fn) -> void {
|
||||
PrettyStackTraceFunction trace_file([&](llvm::raw_ostream& out) {
|
||||
out << "filename: " << input_filename_ << "\n";
|
||||
});
|
||||
CARBON_VLOG("*** {0}: {1} ***\n", logging_label, input_filename_);
|
||||
Timings::ScopedTiming timing(timings_ ? &*timings_ : nullptr, timing_label);
|
||||
fn();
|
||||
|
||||
Reference in New Issue
Block a user