[clang] Include the error message in file reading error diagnostic
authorHans Wennborg <hans@chromium.org>
Fri, 17 Mar 2023 09:59:03 +0000 (10:59 +0100)
committerHans Wennborg <hans@chromium.org>
Fri, 17 Mar 2023 12:47:02 +0000 (13:47 +0100)
commite495eabd326801c1e00508898dbcb04073a31014
tree47e4081a966c6c85c0ce4c517106319b885ede5d
parent2d91b0dae0a902317d384a44f588107d04c9ad3c
[clang] Include the error message in file reading error diagnostic

in order to provide as much information as possible to the user. The
diagnostic will now look like for example:

  error: error reading '/tmp/foo.c': Permission denied

(This addresses a FIXME from 2019, 9ef6c49baf45)

Differential revision: https://reviews.llvm.org/D146280
clang/include/clang/Basic/DiagnosticFrontendKinds.td
clang/lib/Frontend/CompilerInstance.cpp
clang/tools/driver/cc1as_main.cpp
flang/lib/Frontend/FrontendAction.cpp