logic: Cxx destructor decl fixes

* omit visiting a type in the name of a CxxDestructorDecl (which recorded a type reference)
* fixed range of names for Cxx destructors and overleaded operators.
This commit is contained in:
mlangkabel
2017-09-11 15:40:26 +02:00
parent 41348f5130
commit 64a97d37f1
5 changed files with 41 additions and 13 deletions
+12 -3
View File
@@ -461,6 +461,12 @@ bool CxxAstVisitor::TraverseBinComma(clang::BinaryOperator* s)
return true;
}
bool CxxAstVisitor::TraverseDeclarationNameInfo(clang::DeclarationNameInfo NameInfo)
{
// we don't visit any children here
return true;
}
void CxxAstVisitor::traverseDeclContextHelper(clang::DeclContext* d)
{
if (!d)
@@ -682,15 +688,18 @@ ParseLocation CxxAstVisitor::getParseLocation(const clang::SourceRange& sourceRa
{
const clang::SourceManager& sourceManager = m_astContext->getSourceManager();
const clang::PresumedLoc& presumedBegin = sourceManager.getPresumedLoc(sourceRange.getBegin(), false);
const clang::PresumedLoc& presumedEnd = sourceManager.getPresumedLoc(sourceRange.getEnd(), false);
const clang::SourceLocation startLoc = sourceRange.getBegin();
const clang::SourceLocation endLoc = m_preprocessor->getLocForEndOfToken(sourceRange.getEnd());
const clang::PresumedLoc& presumedBegin = sourceManager.getPresumedLoc(startLoc, false);
const clang::PresumedLoc& presumedEnd = sourceManager.getPresumedLoc(endLoc, false);
parseLocation = ParseLocation(
m_canonicalFilePathCache->getValue(presumedBegin.getFilename()),
presumedBegin.getLine(),
presumedBegin.getColumn(),
presumedEnd.getLine(),
presumedEnd.getColumn()
presumedEnd.getColumn() - 1
);
}
return parseLocation;