data: Only record name specifiers within project files
* Use const references in Traverse methods of CxxAstVisitorComponent * Only record symbol kinds of name specifiers within project files * Moved main file check in within unindexed project file check
This commit is contained in:
@@ -1,49 +1,6 @@
|
||||
Token.cpp ERROR: Location Id was not referenced by this Token.
|
||||
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
|
||||
Edge.cpp ERROR: Nodes are not plain copies.
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: send MessageStatus Enabled console and file logging.
|
||||
INFO: send TestMessage
|
||||
INFO: send TestMessage
|
||||
@@ -72,3 +29,46 @@ TextAccess.cpp WARNING: Line numbers start with one, is 0
|
||||
TextAccess.cpp WARNING: Line numbers start with one, is 0
|
||||
TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 2:3 2:1
|
||||
TokenLocationCollection.cpp ERROR: TokenLocation has wrong boundaries: file.c 4:1 1:10
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
INFO: Indexer - indexing source file: input.cc
|
||||
|
||||
@@ -17,8 +17,8 @@ public:
|
||||
virtual void endTraverse##__NAME_TYPE__(clang::__PARAM_TYPE__ *v) {}
|
||||
|
||||
#define DEF_TRAVERSE_CUSTOM_TYPE(__NAME_TYPE__, __PARAM_TYPE__) \
|
||||
virtual void beginTraverse##__NAME_TYPE__(clang::__PARAM_TYPE__ v) {} \
|
||||
virtual void endTraverse##__NAME_TYPE__(clang::__PARAM_TYPE__ v) {}
|
||||
virtual void beginTraverse##__NAME_TYPE__(const clang::__PARAM_TYPE__ &v) {}\
|
||||
virtual void endTraverse##__NAME_TYPE__(const clang::__PARAM_TYPE__ &v) {}
|
||||
|
||||
#define DEF_TRAVERSE_TYPE_PTR(__TYPE__) \
|
||||
DEF_TRAVERSE_CUSTOM_TYPE_PTR(__TYPE__, __TYPE__)
|
||||
|
||||
@@ -93,7 +93,7 @@ void CxxAstVisitorComponentContext::endTraverseDecl(clang::Decl* d)
|
||||
m_contextStack.pop_back();
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentContext::beginTraverseTypeLoc(clang::TypeLoc tl)
|
||||
void CxxAstVisitorComponentContext::beginTraverseTypeLoc(const clang::TypeLoc& tl)
|
||||
{
|
||||
std::shared_ptr<CxxContextType> context;
|
||||
|
||||
@@ -105,7 +105,7 @@ void CxxAstVisitorComponentContext::beginTraverseTypeLoc(clang::TypeLoc tl)
|
||||
m_contextStack.push_back(context);
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentContext::endTraverseTypeLoc(clang::TypeLoc tl)
|
||||
void CxxAstVisitorComponentContext::endTraverseTypeLoc(const clang::TypeLoc& tl)
|
||||
{
|
||||
m_contextStack.pop_back();
|
||||
}
|
||||
@@ -161,12 +161,12 @@ void CxxAstVisitorComponentContext::endTraverseDeclRefExpr(clang::DeclRefExpr* s
|
||||
m_templateArgumentContext.pop_back();
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentContext::beginTraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc)
|
||||
void CxxAstVisitorComponentContext::beginTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc)
|
||||
{
|
||||
m_templateArgumentContext.push_back(std::make_shared<CxxContextType>(loc.getTypePtr(), getAstVisitor()->getTypeNameCache()));
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentContext::endTraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc)
|
||||
void CxxAstVisitorComponentContext::endTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc)
|
||||
{
|
||||
m_templateArgumentContext.pop_back();
|
||||
}
|
||||
|
||||
@@ -20,8 +20,8 @@ public:
|
||||
virtual void beginTraverseDecl(clang::Decl* d);
|
||||
virtual void endTraverseDecl(clang::Decl* d);
|
||||
|
||||
virtual void beginTraverseTypeLoc(clang::TypeLoc tl);
|
||||
virtual void endTraverseTypeLoc(clang::TypeLoc tl);
|
||||
virtual void beginTraverseTypeLoc(const clang::TypeLoc& tl);
|
||||
virtual void endTraverseTypeLoc(const clang::TypeLoc& tl);
|
||||
|
||||
virtual void beginTraverseLambdaExpr(clang::LambdaExpr* s);
|
||||
virtual void endTraverseLambdaExpr(clang::LambdaExpr* s);
|
||||
@@ -38,8 +38,8 @@ public:
|
||||
virtual void beginTraverseDeclRefExpr(clang::DeclRefExpr* s);
|
||||
virtual void endTraverseDeclRefExpr(clang::DeclRefExpr* s);
|
||||
|
||||
virtual void beginTraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc);
|
||||
virtual void endTraverseTemplateSpecializationTypeLoc(clang::TemplateSpecializationTypeLoc loc);
|
||||
virtual void beginTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc);
|
||||
virtual void endTraverseTemplateSpecializationTypeLoc(const clang::TemplateSpecializationTypeLoc& loc);
|
||||
|
||||
virtual void beginTraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* e);
|
||||
virtual void endTraverseUnresolvedLookupExpr(clang::UnresolvedLookupExpr* e);
|
||||
|
||||
@@ -51,26 +51,26 @@ void CxxAstVisitorComponentDeclRefKind::endTraverseStmt(clang::Stmt* s)
|
||||
restoreAll();
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentDeclRefKind::beginTraverseType(clang::QualType t)
|
||||
void CxxAstVisitorComponentDeclRefKind::beginTraverseType(const clang::QualType& t)
|
||||
{
|
||||
saveAll();
|
||||
m_thisRefKind = REFERENCE_USAGE;
|
||||
m_childRefKind = REFERENCE_USAGE;
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentDeclRefKind::endTraverseType(clang::QualType t)
|
||||
void CxxAstVisitorComponentDeclRefKind::endTraverseType(const clang::QualType& t)
|
||||
{
|
||||
restoreAll();
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentDeclRefKind::beginTraverseTypeLoc(clang::TypeLoc tl)
|
||||
void CxxAstVisitorComponentDeclRefKind::beginTraverseTypeLoc(const clang::TypeLoc& tl)
|
||||
{
|
||||
saveAll();
|
||||
m_thisRefKind = REFERENCE_USAGE;
|
||||
m_childRefKind = REFERENCE_USAGE;
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentDeclRefKind::endTraverseTypeLoc(clang::TypeLoc tl)
|
||||
void CxxAstVisitorComponentDeclRefKind::endTraverseTypeLoc(const clang::TypeLoc& tl)
|
||||
{
|
||||
restoreAll();
|
||||
}
|
||||
|
||||
@@ -25,11 +25,11 @@ public:
|
||||
virtual void beginTraverseStmt(clang::Stmt* s);
|
||||
virtual void endTraverseStmt(clang::Stmt* s);
|
||||
|
||||
virtual void beginTraverseType(clang::QualType t);
|
||||
virtual void endTraverseType(clang::QualType t);
|
||||
virtual void beginTraverseType(const clang::QualType& t);
|
||||
virtual void endTraverseType(const clang::QualType& t);
|
||||
|
||||
virtual void beginTraverseTypeLoc(clang::TypeLoc tl);
|
||||
virtual void endTraverseTypeLoc(clang::TypeLoc tl);
|
||||
virtual void beginTraverseTypeLoc(const clang::TypeLoc& tl);
|
||||
virtual void endTraverseTypeLoc(const clang::TypeLoc& tl);
|
||||
|
||||
virtual void beginTraverseCallCommonCallee();
|
||||
|
||||
|
||||
@@ -26,8 +26,13 @@ CxxAstVisitorComponentIndexer::~CxxAstVisitorComponentIndexer()
|
||||
{
|
||||
}
|
||||
|
||||
void CxxAstVisitorComponentIndexer::beginTraverseNestedNameSpecifierLoc(const clang::NestedNameSpecifierLoc loc)
|
||||
void CxxAstVisitorComponentIndexer::beginTraverseNestedNameSpecifierLoc(const clang::NestedNameSpecifierLoc& loc)
|
||||
{
|
||||
if (!shouldVisitReference(loc.getBeginLoc(), getAstVisitor()->getComponent<CxxAstVisitorComponentContext>()->getTopmostContextDecl()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (loc.getNestedNameSpecifier()->getKind())
|
||||
{
|
||||
case clang::NestedNameSpecifier::Identifier:
|
||||
@@ -721,8 +726,14 @@ bool CxxAstVisitorComponentIndexer::isLocatedInUnparsedProjectFile(clang::Source
|
||||
|
||||
if (spellingLoc.isValid())
|
||||
{
|
||||
if (sourceManager.isWrittenInMainFile(spellingLoc))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
fileId = sourceManager.getFileID(spellingLoc);
|
||||
}
|
||||
|
||||
if (fileId.isValid())
|
||||
{
|
||||
auto it = m_inUnparsedProjectFileMap.find(fileId);
|
||||
@@ -732,27 +743,22 @@ bool CxxAstVisitorComponentIndexer::isLocatedInUnparsedProjectFile(clang::Source
|
||||
}
|
||||
|
||||
bool ret = false;
|
||||
if (sourceManager.isWrittenInMainFile(spellingLoc))
|
||||
const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId);
|
||||
if (fileEntry != NULL)
|
||||
{
|
||||
ret = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
const clang::FileEntry* fileEntry = sourceManager.getFileEntryForID(fileId);
|
||||
if (fileEntry != NULL)
|
||||
{
|
||||
std::string fileName = fileEntry->getName();
|
||||
FilePath filePath = FilePath(fileName).canonical();
|
||||
std::string fileName = fileEntry->getName();
|
||||
FilePath filePath = FilePath(fileName).canonical();
|
||||
|
||||
if (m_fileRegister->hasIncludeFile(filePath))
|
||||
{
|
||||
ret = !(m_fileRegister->includeFileIsParsed(filePath));
|
||||
}
|
||||
if (m_fileRegister->hasIncludeFile(filePath))
|
||||
{
|
||||
ret = !(m_fileRegister->includeFileIsParsed(filePath));
|
||||
}
|
||||
}
|
||||
|
||||
m_inUnparsedProjectFileMap[fileId] = ret;
|
||||
return ret;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public:
|
||||
CxxAstVisitorComponentIndexer(CxxAstVisitor* astVisitor, clang::ASTContext* astContext, ParserClient* client, FileRegister* fileRegister);
|
||||
virtual ~CxxAstVisitorComponentIndexer();
|
||||
|
||||
virtual void beginTraverseNestedNameSpecifierLoc(const clang::NestedNameSpecifierLoc loc);
|
||||
virtual void beginTraverseNestedNameSpecifierLoc(const clang::NestedNameSpecifierLoc& loc);
|
||||
virtual void beginTraverseTemplateArgumentLoc(const clang::TemplateArgumentLoc& loc);
|
||||
virtual void beginTraverseLambdaCapture(clang::LambdaExpr *lambdaExpr, const clang::LambdaCapture *capture);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user