From 428b24fcb58f76f09ef94d494445dd1b30e70430 Mon Sep 17 00:00:00 2001 From: hjk Date: Wed, 19 Jun 2019 11:54:51 +0200 Subject: [PATCH] ClangRefactor: Suppress warnings about unused stuff Change-Id: Ib9f25081421e6477c457786e0882322b44e80c62 Reviewed-by: Nikolai Kosjar --- .../source/indexdataconsumer.cpp | 20 +++---------------- .../source/indexdataconsumer.h | 2 +- 2 files changed, 4 insertions(+), 18 deletions(-) diff --git a/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp b/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp index 1fa60434619..8d67d710865 100644 --- a/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp +++ b/src/tools/clangrefactoringbackend/source/indexdataconsumer.cpp @@ -68,7 +68,7 @@ using SymbolKindAndTags = std::pair; class IndexingDeclVisitor : public clang::ConstDeclVisitor { 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()); diff --git a/src/tools/clangrefactoringbackend/source/indexdataconsumer.h b/src/tools/clangrefactoringbackend/source/indexdataconsumer.h index 730ca12b232..83208682281 100644 --- a/src/tools/clangrefactoringbackend/source/indexdataconsumer.h +++ b/src/tools/clangrefactoringbackend/source/indexdataconsumer.h @@ -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: