Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cxxmodules] Use the global module index only when no rootmap candidate is found #9592

Merged
merged 1 commit into from
Jan 26, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions core/metacling/src/TClingCallbacks.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -359,21 +359,20 @@ bool TClingCallbacks::LookupObject(const DeclContext* DC, DeclarationName Name)
if (fIsAutoParsingSuspended || fIsAutoLoadingRecursively)
return false;

if (findInGlobalModuleIndex(Name, /*loadFirstMatchOnly*/ false))
return true;

if (Name.getNameKind() != DeclarationName::Identifier)
return false;

// Get the 'lookup' decl context.
// We need to cast away the constness because we will lookup items of this
// namespace/DeclContext
NamespaceDecl* NSD = dyn_cast<NamespaceDecl>(const_cast<DeclContext*>(DC));
if (!NSD)
return false;

if ( !TCling__IsAutoLoadNamespaceCandidate(NSD) )
return false;
// When GMI is mixed with rootmaps, we might have a name for two different
// entities provided by the two systems. In that case check if the rootmaps
// registered the enclosing namespace as a rootmap name resolution namespace
// and only if that was not the case use the information in the GMI.
if (!NSD || !TCling__IsAutoLoadNamespaceCandidate(NSD))
return findInGlobalModuleIndex(Name, /*loadFirstMatchOnly*/ false);

const DeclContext* primaryDC = NSD->getPrimaryContext();
if (primaryDC != DC)
Expand Down