[flang] Make EndProgramStmt a NOP + early return
authorValentin Clement <clementval@gmail.com>
Wed, 1 Feb 2023 14:53:52 +0000 (15:53 +0100)
committerValentin Clement <clementval@gmail.com>
Wed, 1 Feb 2023 14:55:23 +0000 (15:55 +0100)
commit591e3e6207894ebaee1e47a82fcfb3b246459f76
tree707db094485d11206b423d502854dda1912bea8d
parent78f88082de3627ea04501c83a08f52cf1e60b4f7
[flang] Make EndProgramStmt a NOP + early return

Fix done in D143055 can be simpler by making EndProgramStmt a NOP
and dealing with the exit in `endNewFunction` in a centralize way.
Also add finalization when there is an early exit in the main
program.

Reviewed By: jeanPerier

Differential Revision: https://reviews.llvm.org/D143065
flang/lib/Lower/Bridge.cpp
flang/test/Lower/derived-type-finalization.f90