[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-20 Thread Chuanqi Xu 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 rGce2257d69fd0: [C++20] [Modules] Judge current module correctly (authored by ChuanqiXu). Changed prior to commit:

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-20 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added a comment. In D123837#3461474 , @iains wrote: > thanks for multiple iterations! Thanks for the reviewing! > I think maybe you are using a too old clang-format? > it seems that clang-format >= llvm-14 removes spaces around module

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-20 Thread Iain Sandoe via Phabricator via cfe-commits
iains accepted this revision. iains added a comment. This revision is now accepted and ready to land. thanks for multiple iterations! I think maybe you are using a too old clang-format? it seems that clang-format >= llvm-14 removes spaces around module partition colons ... so `A :

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/include/clang/Basic/Module.h:550-553 if (isModulePartition()) { auto pos = Name.find(':'); return StringRef(Name.data(), pos); } iains wrote: > if we find this is repeated too many times,

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu updated this revision to Diff 423797. ChuanqiXu added a comment. Address comments: - Add tests for GMF - Avoid to compare string if M is private module fragment. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123837/new/ https://reviews.llvm.org/D123837 Files:

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Iain Sandoe via Phabricator via cfe-commits
iains added a comment. it would be good to add tests for GMF and PMF cases? Comment at: clang/include/clang/Basic/Module.h:550-553 if (isModulePartition()) { auto pos = Name.find(':'); return StringRef(Name.data(), pos); } if we find

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/lib/Sema/SemaLookup.cpp:1579 + (M->getPrimaryModuleInterfaceName() == + llvm::StringRef(getLangOpts().CurrentModule).split(':').first)) { +CurrentModuleUnitsCache.insert(M); I thought to add a

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu updated this revision to Diff 423579. ChuanqiXu added a comment. Rename Sema::CurrentModuleUnitsCache to Sema::UsableModuleUnitsCache CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123837/new/ https://reviews.llvm.org/D123837 Files: clang/include/clang/Basic/Module.h

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/include/clang/Basic/Module.h:547-548 +// is the default name showed in module map. +if (isGlobalModule()) + return ""; + I thought to add an assertion here. But I feel like it is not so necessary

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu updated this revision to Diff 423572. ChuanqiXu added a comment. Address comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123837/new/ https://reviews.llvm.org/D123837 Files: clang/include/clang/Basic/Module.h clang/include/clang/Sema/Sema.h

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Iain Sandoe via Phabricator via cfe-commits
iains added inline comments. Comment at: clang/include/clang/Basic/Module.h:537-543 + static StringRef getPrimaryModuleInterfaceName(StringRef Name) { +return Name.split(':').first; + } + /// Get the primary module interface name from a partition. StringRef

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu added inline comments. Comment at: clang/include/clang/Basic/Module.h:537-543 + static StringRef getPrimaryModuleInterfaceName(StringRef Name) { +return Name.split(':').first; + } + /// Get the primary module interface name from a partition. StringRef

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-19 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu updated this revision to Diff 423542. ChuanqiXu added a comment. Address comments: - Add Cache in isInCurrentModule to avoid too many string comparisons. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123837/new/ https://reviews.llvm.org/D123837 Files:

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-18 Thread Iain Sandoe via Phabricator via cfe-commits
iains added inline comments. Comment at: clang/include/clang/Basic/Module.h:537-543 + static StringRef getPrimaryModuleInterfaceName(StringRef Name) { +return Name.split(':').first; + } + /// Get the primary module interface name from a partition. StringRef

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-15 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu updated this revision to Diff 423030. ChuanqiXu added a comment. Fix tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123837/new/ https://reviews.llvm.org/D123837 Files: clang/include/clang/Basic/Module.h clang/lib/Sema/SemaLookup.cpp

[PATCH] D123837: [C++20] [Modules] Judge isInCurrentModule currently

2022-04-15 Thread Chuanqi Xu via Phabricator via cfe-commits
ChuanqiXu created this revision. ChuanqiXu added reviewers: iains, rsmith, clang-language-wg. ChuanqiXu added a project: clang. Herald added a subscriber: dexonsmith. Herald added a project: All. ChuanqiXu requested review of this revision. Herald added a subscriber: cfe-commits. Now the