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
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to