[clang] [llvm] [BPF] Add load-acquire and store-release instructions under -mcpu=v5 (PR #108636)

via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 23 17:49:06 PDT 2024


eddyz87 wrote:

@peilin-ye ,

Sorry for the delayed reply.

> > But there should be a way to tweak existing `fail` function to stop after errors are reported.
> 
> Can we `exit(1)` ? :-)

Let's not hard-code the `exit(1)` in the backend. In case if LLVM is used as a library, such exit might be quite unexpected.
I double checked and clang's diagnostic handler is installed in `clang::BackendConsumer::HandleTranslationUnit()` (clang/lib/CodeGen/CodeGenAction.cpp:294) it redirects all handling to `BackendConsumer::DiagnosticHandlerImpl()`. It does not seem customizable.

I'd say let's go with what you suggest, but avoid `exit(1)` call. We need to figure out how to do `fail()` w/o backtrace, but that is outside of the scope for this pull request.

https://github.com/llvm/llvm-project/pull/108636


More information about the cfe-commits mailing list