If either Prescan or Parse generate any fatal errors, the new driver
will:
- report it (i.e. issue an error diagnostic)
- exit early
- return non-zero exit code
This behaviour is consistent with f18 (i.e. the old driver).
Differential D93712
[flang][driver] Add checks for errors from `Prescan` and `Parse` awarzynski on Dec 22 2020, 8:23 AM. Authored by
Details If either Prescan or Parse generate any fatal errors, the new driver
This behaviour is consistent with f18 (i.e. the old driver).
Diff Detail
Event TimelineComment Actions Mostly nit comments.
Comment Actions I can see how these messages can be useful for a compiler developer; however, perhaps these messages are redundant for end users because other error messages have been issued. Comment Actions Thanks @sameeranjoshi !
Comment Actions Thank you for the suggestion! I actually pushed this change pretty much at the point when you were sending this. Obviously we can refine this. For now I'd like to prioritise consistency with f18. Once flang-new is ready to replace f18, we could focus on refining the user experience. Also, when end-users report erros to developers, it's good to have a message that allows developers narrow the error down. So I still think that it's worthwhile to have specialized error messages (e.g. could not parse vs could not scan) in the driver. Lastly, wouldn't the frontend driver be considered more of a _developer_ rather than _end-user_ tool? |
nit - would be better to use const as much as possible if there are not modifications to the variables.
point 13
https://github.com/llvm/llvm-project/blob/master/flang/docs/C++style.md#c-language