In preparation for expanding this behavior to cover additional cases.
llvm-svn: 302969
return getCompilingModule() != CMK_None;
}
+ /// Do we need to track the owning module for a local declaration?
+ bool trackLocalOwningModule() const {
+ return ModulesLocalVisibility;
+ }
+
bool isSignedOverflowDefined() const {
return getSignedOverflowBehavior() == SOB_Defined;
}
assert(!Parent || &Parent->getParentASTContext() == &Ctx);
// With local visibility enabled, we track the owning module even for local
// declarations.
- if (Ctx.getLangOpts().ModulesLocalVisibility) {
+ if (Ctx.getLangOpts().trackLocalOwningModule()) {
// Ensure required alignment of the resulting object by adding extra
// padding at the start if required.
size_t ExtraAlign =
}
bool Decl::hasLocalOwningModuleStorage() const {
- return getASTContext().getLangOpts().ModulesLocalVisibility;
+ return getASTContext().getLangOpts().trackLocalOwningModule();
}
const char *Decl::getDeclKindName() const {
// The enclosing context is now part of this module.
// FIXME: Consider creating a child DeclContext to hold the entities
// lexically within the module.
- if (getLangOpts().ModulesLocalVisibility) {
+ if (getLangOpts().trackLocalOwningModule()) {
cast<Decl>(CurContext)->setHidden(true);
cast<Decl>(CurContext)->setLocalOwningModule(Mod);
}
BuildModuleInclude(DirectiveLoc, Mod);
// Any further declarations are in whatever module we returned to.
- if (getLangOpts().ModulesLocalVisibility) {
+ if (getLangOpts().trackLocalOwningModule()) {
cast<Decl>(CurContext)->setLocalOwningModule(getCurrentModule());
if (!getCurrentModule())
cast<Decl>(CurContext)->setHidden(false);