[flang] Set proper source location for the main function.
authorSlava Zakharin <szakharin@nvidia.com>
Fri, 17 Mar 2023 23:52:19 +0000 (16:52 -0700)
committerSlava Zakharin <szakharin@nvidia.com>
Tue, 21 Mar 2023 19:32:42 +0000 (12:32 -0700)
commitee7b6fd4c1c11641f9b1b54441ed038fd761de13
tree12909c20ad61f0e63074d2d56589e1d80c17314a
parentae484c21c05668f84b13304c28bc39f753e493de
[flang] Set proper source location for the main function.

Take the source position for the anonymous program from its scope.
If the first evaluation is a construct or directive, then it has
null source position.

Author: vdonaldson
Differential Revision: https://reviews.llvm.org/D146445
flang/lib/Lower/PFTBuilder.cpp
flang/test/Lower/main_location.f90 [new file with mode: 0644]