[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-29 Thread David Truby via cfe-commits
https://github.com/DavidTruby closed https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-29 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/89938 >From 2b7ee836b985ee6fa8f7d57ccdee733f261a1de1 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 24 Apr 2024 14:35:23 + Subject: [PATCH 1/3] [flang] Generate main only when a Fortran program

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-26 Thread Daniel Chen via cfe-commits
https://github.com/DanielCChen approved this pull request. Thanks for working on this. We have quite some Fortran C-interop test cases are affected by the "duplicate main" error. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-26 Thread Paul Osmialowski via cfe-commits
https://github.com/pawosm-arm approved this pull request. The -fno-fortran-main flag should disappear before it finds any widespread use. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-26 Thread Tom Eccles via cfe-commits
https://github.com/tblah approved this pull request. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread David Truby via cfe-commits
DavidTruby wrote: As regards the backwards compatibility break here, I guess my take is that this change needs to happen some time and sooner is always going to be better than later. While we are still called flang-new and marked experimental I'm inclined to think we should just rip the band

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread David Truby via cfe-commits
DavidTruby wrote: > Great work David, thanks! Could you add some documentation explaining _where_ > `main` would be coming from in the case of mixed-source compilation? In fact, > is that tested anywhere? > > Also, IMHO it would be good to advertise this on Discourse (thinking > specifically

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Andrzej WarzyƄski via cfe-commits
banach-space wrote: Great work David, thanks! Could you add some documentation explaining _where_ `main` would be coming from in the case of mixed-source compilation? In fact, is that tested anywhere? Also, IMHO it would be good to advertise this on Discourse (thinking specifically about

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Kelvin Li via cfe-commits
kkwli wrote: This change will also break backward compatibility that the old object file that contain `main` can no longer use the new compiler to link with other objects. I think we can put a warning in the release note or something like that to warn users.

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Tom Eccles via cfe-commits
@@ -1191,118 +1191,10 @@ bool tools::addOpenMPRuntime(const Compilation , ArgStringList , return true; } -/// Determines if --whole-archive is active in the list of arguments. -static bool isWholeArchivePresent(const ArgList ) { - bool WholeArchiveActive = false; - for

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Tom Eccles via cfe-commits
https://github.com/tblah edited https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Tom Eccles via cfe-commits
https://github.com/tblah commented: Thanks for this. I'm sure it will give a big improvement to the experience of building applications with flang. Code changes look good to me. I'm worried about how this could break existing builds using `-fno-fortran-main` and `-lFortran_main`. Do you have

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-25 Thread Tom Eccles via cfe-commits
@@ -6582,12 +6582,6 @@ def J : JoinedOrSeparate<["-"], "J">, Group, Alias; -let Visibility = [FlangOption] in { -def no_fortran_main : Flag<["-"], "fno-fortran-main">, tblah wrote: Will this break existing build systems configured to use this flag?

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread Kelvin Li via cfe-commits
@@ -24,6 +24,7 @@ add_flang_library(FIRBuilder Runtime/Inquiry.cpp Runtime/Intrinsics.cpp Runtime/Numeric.cpp + Runtime/Main.cpp kkwli wrote: I think this list is in alphabetical order? https://github.com/llvm/llvm-project/pull/89938

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread Kelvin Li via cfe-commits
https://github.com/kkwli approved this pull request. LG https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread Kelvin Li via cfe-commits
https://github.com/kkwli edited https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread Peter Klausler via cfe-commits
@@ -0,0 +1,63 @@ +//===-- Main.cpp - generate main runtime API calls *- C++ klausler wrote: This header comment needs to be cleaned up. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread Peter Klausler via cfe-commits
https://github.com/klausler edited https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread Peter Klausler via cfe-commits
https://github.com/klausler approved this pull request. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread via cfe-commits
github-actions[bot] wrote: :white_check_mark: With the latest revision this PR passed the C/C++ code formatter. https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread David Truby via cfe-commits
https://github.com/DavidTruby updated https://github.com/llvm/llvm-project/pull/89938 >From 88db34e906f6eb104f8d84fa9ad4f0aa49607c68 Mon Sep 17 00:00:00 2001 From: David Truby Date: Wed, 24 Apr 2024 14:35:23 + Subject: [PATCH 1/2] [flang] Generate main only when a Fortran program

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread David Truby via cfe-commits
https://github.com/DavidTruby edited https://github.com/llvm/llvm-project/pull/89938 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-clang-driver Author: David Truby (DavidTruby) Changes This patch changes the behaviour for flang to only create and link to a `main` entry point when the Fortran code has a program statement in it. This means that flang-new can be used to link even

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread via cfe-commits
llvmbot wrote: @llvm/pr-subscribers-lld @llvm/pr-subscribers-lld-coff @llvm/pr-subscribers-flang-fir-hlfir Author: David Truby (DavidTruby) Changes This patch changes the behaviour for flang to only create and link to a `main` entry point when the Fortran code has a program statement in

[clang] [flang] [lld] [flang] Generate main only when a Fortran program statement is present (PR #89938)

2024-04-24 Thread David Truby via cfe-commits
https://github.com/DavidTruby created https://github.com/llvm/llvm-project/pull/89938 This patch changes the behaviour for flang to only create and link to a `main` entry point when the Fortran code has a program statement in it. This means that flang-new can be used to link even when the