[flang][driver] Add checks for missing option arguments
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Wed, 2 Jun 2021 20:53:02 +0000 (21:53 +0100)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Fri, 4 Jun 2021 14:16:56 +0000 (15:16 +0100)
commit2b4c9bc4d489a4be1c5aa1924fba542dc80ab0c9
tree83777df26bb41edc7484725f328fea73b5d295a6
parentf03f4944cf829c86bc2c080b9a564bbc59aad277
[flang][driver] Add checks for missing option arguments

With this patch, the following invocation of the frontend driver will
return an error:
```
flang-new -fc1 input-file.f90 -o
```
Similar logic applies to other options that require arguments.

Similar checks are already available in the compiler driver, flang-new
(that's implemented in clangDriver).

Differential Revision: https://reviews.llvm.org/D103554
flang/lib/Frontend/CompilerInvocation.cpp
flang/test/Driver/missing-arg.f90 [new file with mode: 0644]