[flang-commits] [flang] [flang] Prevent errors from being suppressed (PR #114420)

IƱaki Amatria Barral via flang-commits flang-commits at lists.llvm.org
Sat Nov 2 04:53:32 PDT 2024


inaki-amatria wrote:

> A module file with an incorrect checksum might still be valid or useful, so I didn't want the error to be fatal. Sometimes it is useful (but dangerous) to be able to modify a module file by hand.

Thank you for the feedback, klausler! I believe there is a slight mismatch in the current code's behavior and the intent described here. Even if Flang does not report this error specifically, `nullptr` is still returned, which prevents the module file with the incorrect checksum from being imported. This ultimately results in a semantics error along the lines of "symbol 'xyz' does not exist". In my opinion, reporting the specific error from `ModuleFileReader::Read()` offers a clearer and more precise message than a general missing symbol error.

> If you must turn these warnings into unconditional errors, then Fortran::common::UsageWarning::ModuleFile will become obsolete and should be deleted.

I have added a fixup commit removing `Fortran::common::UsageWarning::ModuleFile` and its uses.

Thanks again for the review! Please feel free to close or merge the PR if you are in agreement.


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


More information about the flang-commits mailing list