forked from qt-creator/qt-creator
ClangRefactor: Suppress warnings about unused stuff
Change-Id: Ib9f25081421e6477c457786e0882322b44e80c62 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
@@ -68,7 +68,7 @@ using SymbolKindAndTags = std::pair<SymbolKind, SymbolTags>;
|
|||||||
class IndexingDeclVisitor : public clang::ConstDeclVisitor<IndexingDeclVisitor, SymbolKindAndTags>
|
class IndexingDeclVisitor : public clang::ConstDeclVisitor<IndexingDeclVisitor, SymbolKindAndTags>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
SymbolKindAndTags VisitEnumDecl(const clang::EnumDecl *declaration)
|
SymbolKindAndTags VisitEnumDecl(const clang::EnumDecl */*declaration*/)
|
||||||
{
|
{
|
||||||
return {SymbolKind::Enumeration, {}};;
|
return {SymbolKind::Enumeration, {}};;
|
||||||
}
|
}
|
||||||
@@ -103,23 +103,9 @@ SymbolKindAndTags symbolKindAndTags(const clang::Decl *declaration)
|
|||||||
return visitor.Visit(declaration);
|
return visitor.Visit(declaration);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isDeclaration(clang::index::SymbolRoleSet symbolRoles)
|
|
||||||
{
|
|
||||||
using namespace clang::index;
|
|
||||||
|
|
||||||
return symbolRoles & (uint(SymbolRole::Declaration) | uint(SymbolRole::Definition));
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isReference(clang::index::SymbolRoleSet symbolRoles)
|
|
||||||
{
|
|
||||||
using namespace clang::index;
|
|
||||||
|
|
||||||
return symbolRoles & (uint(SymbolRole::Reference) | uint(SymbolRole::Call));
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
bool IndexDataConsumer::skipSymbol(clang::FileID fileId, clang::index::SymbolRoleSet symbolRoles)
|
bool IndexDataConsumer::skipSymbol(clang::FileID fileId)
|
||||||
{
|
{
|
||||||
return isAlreadyParsed(fileId, m_symbolSourcesManager)
|
return isAlreadyParsed(fileId, m_symbolSourcesManager)
|
||||||
&& !m_symbolSourcesManager.dependentFilesModified();
|
&& !m_symbolSourcesManager.dependentFilesModified();
|
||||||
@@ -150,7 +136,7 @@ bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration,
|
|||||||
if (!namedDeclaration->getIdentifier())
|
if (!namedDeclaration->getIdentifier())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
if (skipSymbol(m_sourceManager->getFileID(sourceLocation), symbolRoles))
|
if (skipSymbol(m_sourceManager->getFileID(sourceLocation)))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
SymbolIndex globalId = toSymbolIndex(declaration->getCanonicalDecl());
|
SymbolIndex globalId = toSymbolIndex(declaration->getCanonicalDecl());
|
||||||
|
@@ -75,7 +75,7 @@ public:
|
|||||||
void finish() override;
|
void finish() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool skipSymbol(clang::FileID fileId, clang::index::SymbolRoleSet symbolRoles);
|
bool skipSymbol(clang::FileID fileId);
|
||||||
bool isAlreadyParsed(clang::FileID fileId, SourcesManager &sourcesManager);
|
bool isAlreadyParsed(clang::FileID fileId, SourcesManager &sourcesManager);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user