Skip to content

Commit

Permalink
[NFC] [C++20] [Modules] Refactoring b6c7177 to make it not
Browse files Browse the repository at this point in the history
dependent on f109b10

Given
f109b10#commitcomment-113477829,
we need to revert f109b10. So it will be better to make this patch not
dependent on f109b10 as much as possible.
  • Loading branch information
ChuanqiXu9 committed May 16, 2023
1 parent 9725c74 commit 40c3054
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion clang/lib/AST/ASTContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11927,7 +11927,9 @@ bool ASTContext::DeclMustBeEmitted(const Decl *D) {
return false;

// Variables in other module units shouldn't be forced to be emitted.
if (VD->isInAnotherModuleUnit())
auto *VM = VD->getOwningModule();
if (VM && VM->getTopLevelModule()->isModulePurview() &&
VM->getTopLevelModule() != getCurrentNamedModule())
return false;

// Variables that can be needed in other TUs are required.
Expand Down

0 comments on commit 40c3054

Please sign in to comment.