bool isAcceptableSlow(const NamedDecl *D, AcceptableKind Kind);
- // Determine whether the module M belongs to the current TU.
- bool isModuleUnitOfCurrentTU(const Module *M) const;
-
public:
/// Get the module unit whose scope we are currently within.
Module *getCurrentModule() const {
return DirectModuleImports.contains(M);
}
+ // Determine whether the module M belongs to the current TU.
+ bool isModuleUnitOfCurrentTU(const Module *M) const;
+
/// Make a merged definition of an existing hidden definition \p ND
/// visible at the specified location.
void makeMergedDefinitionVisible(NamedDecl *ND);
// If D comes from a module and SemaRef doesn't own a module, it implies D
// comes from another TU. In case SemaRef owns a module, we could judge if D
// comes from another TU by comparing the module unit.
- //
- // FIXME: It would look better if we have direct method to judge whether D is
- // in another TU.
- if (SemaRef.getCurrentModule() &&
- SemaRef.getCurrentModule()->getTopLevelModule() ==
- DeclModule->getTopLevelModule())
+ if (SemaRef.isModuleUnitOfCurrentTU(DeclModule))
return true;
// [module.reach]/p3: