[PATCH] D95127: [flang][driver] Disallow non-existent input files in the frontend driver

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 21 08:18:54 PST 2021


tskeith added inline comments.


================
Comment at: flang/lib/Frontend/FrontendAction.cpp:40
+  if (input.file() != "-") {
+    if (!llvm::vfs::getRealFileSystem()->exists(input.file())) {
+      ci.diagnostics().Report(clang::diag::err_fe_error_reading)
----------------
What happens if the argument exists but is not a file?


================
Comment at: flang/lib/Frontend/FrontendAction.cpp:42
+      ci.diagnostics().Report(clang::diag::err_fe_error_reading)
+          << input.file();
+      BeginSourceFileCleanUp(*this, ci);
----------------
It looks like this only says "error reading <file>". It would be nice to say what the error is.


================
Comment at: flang/test/Flang-Driver/missing-input.f90:13
+! RUN: not %flang-new  2>&1 | FileCheck %s --check-prefix=FLANG-NO-FILE
+! RUN: not %flang-new %t 2>&1 | FileCheck %s --check-prefix=FLANG-NOEXISITANT-FILE
+
----------------
NOEXISITANT -> NONEXISTENT ?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D95127/new/

https://reviews.llvm.org/D95127



More information about the llvm-commits mailing list