logic: fixed policy for recording elements inside macro arguments and bodies

This commit is contained in:
mlangkabel
2017-12-21 12:50:37 +01:00
parent 30d4e61bb6
commit 88d90bde8f
58 changed files with 4307 additions and 45 deletions
@@ -795,7 +795,13 @@ bool CxxAstVisitorComponentIndexer::shouldVisitDecl(const clang::Decl* decl)
{
if (decl)
{
clang::SourceLocation loc = decl->getLocation();
clang::SourceLocation loc = m_astContext->getSourceManager().getExpansionLoc(decl->getLocation());
if (loc.isInvalid())
{
loc = decl->getLocation();
}
bool declIsImplicit = utility::isImplicit(decl);
if ((declIsImplicit && isLocatedInProjectFile(loc)) ||
(!declIsImplicit && isLocatedInUnparsedProjectFile(loc)))
@@ -814,8 +820,14 @@ bool CxxAstVisitorComponentIndexer::shouldVisitReference(const clang::SourceLoca
declIsImplicit = utility::isImplicit(contextDecl);
}
if ((declIsImplicit && isLocatedInProjectFile(referenceLocation)) ||
(!declIsImplicit && isLocatedInUnparsedProjectFile(referenceLocation)))
clang::SourceLocation loc = m_astContext->getSourceManager().getExpansionLoc(referenceLocation);
if (loc.isInvalid())
{
loc = referenceLocation;
}
if ((declIsImplicit && isLocatedInProjectFile(loc)) ||
(!declIsImplicit && isLocatedInUnparsedProjectFile(loc)))
{
return true;
}