[flang] Honor #line and related preprocessing directives
authorPeter Klausler <pklausler@nvidia.com>
Fri, 23 Jun 2023 18:01:33 +0000 (11:01 -0700)
committerPeter Klausler <pklausler@nvidia.com>
Thu, 29 Jun 2023 15:27:37 +0000 (08:27 -0700)
commite12ffe6a93505e590158ddd8cc73a4f201bbf0aa
tree196ebc69ab14d6907bc7b40c879f1a5d2f5b6929
parentbe8a65b598b3b80f73e862a01c7eaafe84d853a0
[flang] Honor #line and related preprocessing directives

Extend the SourceFile class to take account of #line directives
when computing source file positions for error messages.
Adjust the output of #line directives to -E output so that they
reflect any #line directives that were in the input.

Differential Revision: https://reviews.llvm.org/D153910
15 files changed:
flang/examples/FlangOmpReport/FlangOmpReportVisitor.cpp
flang/include/flang/Parser/source.h
flang/lib/Frontend/FrontendActions.cpp
flang/lib/Lower/Bridge.cpp
flang/lib/Parser/parsing.cpp
flang/lib/Parser/preprocessor.cpp
flang/lib/Parser/preprocessor.h
flang/lib/Parser/prescan.cpp
flang/lib/Parser/prescan.h
flang/lib/Parser/provenance.cpp
flang/lib/Parser/source.cpp
flang/lib/Semantics/semantics.cpp
flang/test/Driver/debug-provenance.f90
flang/test/Parser/line-directive.f90 [new file with mode: 0644]
flang/test/Semantics/line-directive.f90 [new file with mode: 0644]