anutosh491 wrote:

My first approach here 
https://github.com/llvm/llvm-project/pull/169989#issuecomment-3591621666 
highlights how I thought dropping the faulty module having the IR leaked from 
the input line above was the solution. This is what 
[commit1](https://github.com/llvm/llvm-project/pull/169989/commits/a6c9ac10aca449bee2fdebd8e0ec9fe7d363d0ad)
 was trying to do.

But on discussing with @vgvassilev , we discovered that we're making a call to 
codegen even when an error has occured.

So basically we don’t want failing inputs to produce IR or leak state into 
subsequent cells. This patch adds a guard in 
`InProcessPrintingASTConsumer::HandleTopLevelDecl` that returns early when 
`DiagnosticsEngine::hasErrorOccurred()` is `true`, so the 
`MultiplexConsumer/CodeGen` path is not invoked for erroneous inputs. 

https://github.com/llvm/llvm-project/pull/169989
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to