[all-commits] [llvm/llvm-project] 760e6c: [flang][driver] Disallow non-existent input files ...

Andrzej WarzyƄski via All-commits all-commits at lists.llvm.org
Tue Feb 2 02:05:37 PST 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 760e6c4ce58324856d8f105b37bb974564e0f170
      https://github.com/llvm/llvm-project/commit/760e6c4ce58324856d8f105b37bb974564e0f170
  Author: Andrzej Warzynski <andrzej.warzynski at arm.com>
  Date:   2021-02-02 (Tue, 02 Feb 2021)

  Changed paths:
    M flang/lib/Frontend/CompilerInvocation.cpp
    M flang/lib/Frontend/FrontendAction.cpp
    M flang/test/Flang-Driver/missing-input.f90

  Log Message:
  -----------
  [flang][driver] Disallow non-existent input files in the frontend driver

This patch adds a check that verifies that the input file used when
calling the frontend driver (i.e. `flang-new -fc1`) actually exists.
This was not required for the compiler driver, `flang-new`, as that's
already handled in libclangDriver.

Once all input/output file management is moved to the driver, we should
also check that for input from `stdin` the corresponding file descriptor
was successfully acquired.

This patch also makes sure that the default action in the frontend is
`ParseSyntaxOnly`. This is consistent with Clang. Before this change
`flang-new -fc1` would do nothing, which makes testing changes like the
one introduced here a bit tricky.

Reviewed By: SouraVX

Differential Revision: https://reviews.llvm.org/D95127




More information about the All-commits mailing list