mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-01 22:02:45 +01:00
This is a variation on #1339 and also fixes #1338. The important difference from #1339 is that this works to retain the benefits of #1216 which seem important -- both the clarity of printing the message last and the correctness of actually showing the correct line number in the backtrace. The approach in this patch is to disable LLVM's error handling just before using `std::abort()`. This should give us roughly the best of both worlds. This PR also fixes an issue where we wouldn't run the file-cleanup actions that the LLVM `std::abort()` handler does. This almost certainly doesn't yet matter, but likely would in the future. We should separately consider adding back information about filing bugs that roughly corresponds to the error message that LLVM itself prints. I've not tried to replicate that from #1339 here and just focused on getting to `std::abort()` while preserving the desired order of messages and stack trace locations.