[flang][driver] Fix `-fdebug-dump-provenance`
authorAndrzej Warzynski <andrzej.warzynski@arm.com>
Wed, 7 Apr 2021 13:10:35 +0000 (13:10 +0000)
committerAndrzej Warzynski <andrzej.warzynski@arm.com>
Wed, 7 Apr 2021 13:15:09 +0000 (13:15 +0000)
commit85b86c6f43ab50ba70571ed49da7e81f7d52ffd2
tree176c625b120ff6d925e458dfc9564e4b3d566a97
parentbf6cab6f07e1db2329c36b5d8009bf4b16d2761c
[flang][driver] Fix `-fdebug-dump-provenance`

The -fdebug-dump-provenance flag is meant to be used with
needProvenanceRangeToCharBlockMappings set to true. This way, extra
mapping is generated that allows e.g. IDEs to retrieve symbol's scope
(offset into cooked character stream) based on symbol's source code
location. This patch makes sure that this option is set when using
-fdebug-dump-provenance.

With this patch, the implementation of  -fdebug-dump-provenance in
`flang-new -fc1` becomes consistent with `f18`. The corresponding LIT
test is updated so that it can be shared with `f18`. I refined it a bit
so that:
  * it becomes a frontend-only test
  * it's stricter about the expected output

Differential Revision: https://reviews.llvm.org/D98847
flang/include/flang/Frontend/FrontendOptions.h
flang/lib/Frontend/CompilerInvocation.cpp
flang/test/Driver/debug-provenance.f90