ClangRefactor: Suppress warnings about unused stuff

Change-Id: Ib9f25081421e6477c457786e0882322b44e80c62
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
This commit is contained in:
hjk
2019-06-19 11:54:51 +02:00
parent 66a875ac53
commit 428b24fcb5
2 changed files with 4 additions and 18 deletions

View File

@@ -68,7 +68,7 @@ using SymbolKindAndTags = std::pair<SymbolKind, SymbolTags>;
class IndexingDeclVisitor : public clang::ConstDeclVisitor<IndexingDeclVisitor, SymbolKindAndTags>
{
public:
SymbolKindAndTags VisitEnumDecl(const clang::EnumDecl *declaration)
SymbolKindAndTags VisitEnumDecl(const clang::EnumDecl */*declaration*/)
{
return {SymbolKind::Enumeration, {}};;
}
@@ -103,23 +103,9 @@ SymbolKindAndTags symbolKindAndTags(const clang::Decl *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
bool IndexDataConsumer::skipSymbol(clang::FileID fileId, clang::index::SymbolRoleSet symbolRoles)
bool IndexDataConsumer::skipSymbol(clang::FileID fileId)
{
return isAlreadyParsed(fileId, m_symbolSourcesManager)
&& !m_symbolSourcesManager.dependentFilesModified();
@@ -150,7 +136,7 @@ bool IndexDataConsumer::handleDeclOccurence(const clang::Decl *declaration,
if (!namedDeclaration->getIdentifier())
return true;
if (skipSymbol(m_sourceManager->getFileID(sourceLocation), symbolRoles))
if (skipSymbol(m_sourceManager->getFileID(sourceLocation)))
return true;
SymbolIndex globalId = toSymbolIndex(declaration->getCanonicalDecl());

View File

@@ -75,7 +75,7 @@ public:
void finish() override;
private:
bool skipSymbol(clang::FileID fileId, clang::index::SymbolRoleSet symbolRoles);
bool skipSymbol(clang::FileID fileId);
bool isAlreadyParsed(clang::FileID fileId, SourcesManager &sourcesManager);
private: