qiongsiwu wrote:

> If this error case should never happen to module files unless of a compiler 
> logic error, can we add a note that makes that more obvious?
> 
> Maybe something like `note: internal compiler error when validating module 
> file, clear cache <path to module cache>`.
> 
> This is what the swift compiler reports for a class of serialization errors.
> 
> ```
> error: failed to verify module interface of '...' due to the errors above; 
> the textual interface may be broken by project issues or a compiler bug
> ```

I think this error could happen without a compiler bug. If there are concurrent 
modifications of the input headers while the modules are getting build, I think 
this error will be triggered. I don't think clearing the module cache can 
reliably fix such races. I think for this particular case, this diagnostic is 
good enough, as it spells out the exact header that is modified to debug the 
potential race.

As a separate task though, I can look into for which clang errors we should 
implement a diagnostics similar to what Swift has and implement them. Let me 
know if you agree with this approach. 

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

Reply via email to