[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-22 Thread Iain Sandoe via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGafda39a566d9: re-land [C++20][Modules] Build module static initializers per P1874R1. (authored by iains). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12618

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-21 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added a comment. I feel like we could land this sooner to avoid any unimagined failures. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 ___ cfe-commi

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-19 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3662123 , @h-vetinari wrote: > Is it realistic for this to land before LLVM 15 branches? Would be great! that is the intention - I just got side-tracked with trying to replicate the test fails that got the commit rever

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-19 Thread H. Vetinari via Phabricator via cfe-commits
h-vetinari added a comment. Is it realistic for this to land before LLVM 15 branches? Would be great! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 ___ cfe-co

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-15 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 444989. iains added a comment. rebased, fixed the interaction with clang module map modules. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 Files: clang/include/clan

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-15 Thread Iain Sandoe via Phabricator via cfe-commits
iains reopened this revision. iains added a comment. This revision is now accepted and ready to land. reopening to post the patch I intend to land. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. > hmm there seems to be a compiler error, which looks somewhat unrelated to the > active patch: > > > /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/cross-project-tests/debuginfo-tests/clang_llvm_roundtrip/simplified_template_names.cpp:125:27: > error: n

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. I need to do some more builds to be able to reproduce this - my guess (at present) is that this is a manifestation of '-fcxx-modules -std=c++20' being almost, but not exactly, the same as C++20 standardised modules. It is possible that the -gmodules flag interacts with t

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Jonas Devlieghere via Phabricator via cfe-commits
JDevlieghere added a comment. In D126189#3643045 , @iains wrote: > In D126189#3643021 , @JDevlieghere > wrote: > >> In D126189#3643001 , @iains wrote: >> >>> In D126189#3

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3643021 , @JDevlieghere wrote: > In D126189#3643001 , @iains wrote: > >> In D126189#3642992 , @JDevlieghere >> wrote: >> >>> In D126189

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Jonas Devlieghere via Phabricator via cfe-commits
JDevlieghere added a comment. In D126189#3643001 , @iains wrote: > In D126189#3642992 , @JDevlieghere > wrote: > >> In D126189#3642820 , @iains wrote: >> >>> JFTR, I did

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3642992 , @JDevlieghere wrote: > In D126189#3642820 , @iains wrote: > >> JFTR, I did not get any notification from green dragon (which is odd, AFAIR >> it's sent email before) o

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Jonas Devlieghere via Phabricator via cfe-commits
JDevlieghere added a comment. In D126189#3642820 , @iains wrote: > JFTR, I did not get any notification from green dragon (which is odd, AFAIR > it's sent email before) or I would have looked right away - kicked off a > build will take a look as soon a

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3642779 , @JDevlieghere wrote: > In D126189#3642777 , @iains wrote: > >> In D126189#3642762 , @JDevlieghere >> wrote: >> >>> This break

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3642777 , @iains wrote: > In D126189#3642762 , @JDevlieghere > wrote: > >> This breaks TestDataFormatterLibcxxSpan.py on GreenDragon: >> >> Undefined symbols for architecture x

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Jonas Devlieghere via Phabricator via cfe-commits
JDevlieghere added a comment. In D126189#3642777 , @iains wrote: > In D126189#3642762 , @JDevlieghere > wrote: > >> This breaks TestDataFormatterLibcxxSpan.py on GreenDragon: >> >> Undefined symbols for archite

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3642762 , @JDevlieghere wrote: > This breaks TestDataFormatterLibcxxSpan.py on GreenDragon: > > Undefined symbols for architecture x86_64: > "__ZGIW10std_config", referenced from: > __GLOBAL__sub_I_main.cpp

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-11 Thread Jonas Devlieghere via Phabricator via cfe-commits
JDevlieghere added a comment. This breaks TestDataFormatterLibcxxSpan.py on GreenDragon: Undefined symbols for architecture x86_64: "__ZGIW10std_config", referenced from: __GLOBAL__sub_I_main.cpp in main.o "__ZGIW4span", referenced from: __GLOBAL__sub_I_main.cpp in main.

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-07-09 Thread Iain Sandoe via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGac507102d258: [C++20][Modules] Build module static initializers per P1874R1. (authored by iains). Repository: rG LLVM Github Monorepo CHANGES SIN

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-30 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added a comment. In D126189#3617896 , @iains wrote: > In D126189#3617850 , @ChuanqiXu > wrote: > >> @iains may I ask what's the issue to not land this? It looks like you're >> waiting for the behavior

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-29 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3598568 , @urnathan wrote: > please sed /initialiser/initializer/, I noticed a few had crept in. should be done now. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/n

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-29 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 440924. iains added a comment. rebased, corrected some spellings. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 Files: clang/include/clang/AST/ASTContext.h clang/

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-29 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. In D126189#3617850 , @ChuanqiXu wrote: > @iains may I ask what's the issue to not land this? It looks like you're > waiting for the behavior to be consistency with GCC? > > Since this patch could fix https://github.com/llvm/llvm-pr

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-29 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added a comment. @iains may I ask what's the issue to not land this? It looks like you're waiting for the behavior to be consistency with GCC? Since this patch could fix https://github.com/llvm/llvm-project/issues/51873, which breaks the users to compile a hello world example. Repos

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-21 Thread Nathan Sidwell via Phabricator via cfe-commits
urnathan added a comment. please sed /initialiser/initializer/, I noticed a few had crept in. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 ___ cfe-commits ma

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-13 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. @urnathan - I believe that this now implements the same scheme as you have done for GCC (less any of the optimisations). In particular, we now emit global CTOR entries for module initializers, even though these should really be called explicitly, but as was discussed on th

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-13 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 436487. iains added a comment. rebased. Amended to include a global CTOR entry for each module kind. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 Files: clang/incl

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-07 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 434781. iains added a comment. rebased Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/Basic/Module.

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-06-03 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 434003. iains edited the summary of this revision. iains added a comment. rebased and updated previously, this was not doing the right thing for module implementation units which were being processed as if they were interfaces, so we've introduced a module imp

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-31 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu accepted this revision. ChuanqiXu added a comment. This revision is now accepted and ready to land. LGTM, thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-31 Thread Iain Sandoe via Phabricator via cfe-commits
iains added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:645-646 + llvm::raw_svector_ostream Out(FnName); + cast(getCXXABI().getMangleContext()) + .mangleModuleInitializer(M, Out); +} ChuanqiXu wrote: > iains wrote: > > Chua

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-31 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 433049. iains marked 7 inline comments as done. iains added a comment. rebased, addressed review comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 Files: clan

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-27 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:621 +void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) { + while (!CXXGlobalInits.empty() && !CXXGlobalInits.back()) iains wrote: > ChuanqiXu wrote: > > iains wrote: > > > Ch

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-27 Thread Iain Sandoe via Phabricator via cfe-commits
iains added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:621 +void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) { + while (!CXXGlobalInits.empty() && !CXXGlobalInits.back()) ChuanqiXu wrote: > iains wrote: > > ChuanqiXu wrote: > > > Re

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-26 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:621 +void CodeGenModule::EmitCXXModuleInitFunc(Module *Primary) { + while (!CXXGlobalInits.empty() && !CXXGlobalInits.back()) iains wrote: > ChuanqiXu wrote: > > Recommend to comment

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-26 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. not sure why the Debian clang-format is complaining - I am using llvm-14's clang-format with git clang-format + arc. Comment at: clang/include/clang/AST/ASTContext.h:476 + /// For module code-gen cases, this is the top-level module we are building. + m

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-26 Thread Iain Sandoe via Phabricator via cfe-commits
iains updated this revision to Diff 432241. iains marked 14 inline comments as done. iains added a comment. address review comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126189/new/ https://reviews.llvm.org/D126189 Files: clang/include/c

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-26 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:699 +Guard = new llvm::GlobalVariable(getModule(), Int8Ty, /*isConstant=*/false, + llvm::GlobalVariable::InternalLinkage, + llv

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-26 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/include/clang/AST/ASTContext.h:476 + /// For module code-gen cases, this is the top-level module we are building. + mutable Module *PrimaryModule = nullptr; + The name `PrimaryModule` looks confusing. PrimaryMo

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-23 Thread Nathan Sidwell via Phabricator via cfe-commits
urnathan added inline comments. Comment at: clang/lib/CodeGen/CGDeclCXX.cpp:626-627 + // We create the function, even if it is empty, since an importer of this + // module will refer to it unconditionally (there is no way for an importer + // to know if the function could be o

[PATCH] D126189: [C++20][Modules] Build module static initializers per P1874R1.

2022-05-23 Thread Iain Sandoe via Phabricator via cfe-commits
iains created this revision. Herald added a project: All. iains added reviewers: urnathan, Bigcheese, ChuanqiXu, jansvoboda11. iains added a subscriber: clang-modules. iains edited the summary of this revision. iains edited the summary of this revision. iains edited the summary of this revision. ia