From d02d9b0f43a1e831a957194675809001336ac0b1 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Wed, 22 Aug 2018 17:14:48 +0200 Subject: [PATCH] ClangRefactoring: Remove FileCache from SymbolStorage It is not used. Change-Id: Iaff5a34dfe613f0a627e0a3a727af1130ad2b522 Reviewed-by: Ivan Donchevskii --- src/tools/clangrefactoringbackend/source/symbolindexing.h | 2 +- src/tools/clangrefactoringbackend/source/symbolstorage.h | 7 ++----- tests/unit/unittest/symbolstorage-test.cpp | 3 +-- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/tools/clangrefactoringbackend/source/symbolindexing.h b/src/tools/clangrefactoringbackend/source/symbolindexing.h index f6c4e796288..96f6ecb1e5a 100644 --- a/src/tools/clangrefactoringbackend/source/symbolindexing.h +++ b/src/tools/clangrefactoringbackend/source/symbolindexing.h @@ -68,7 +68,7 @@ private: FilePathCachingInterface &m_filePathCache; SymbolsCollector m_collector{m_filePathCache}; StatementFactory m_statementFactory; - Storage m_symbolStorage{m_statementFactory, m_filePathCache}; + Storage m_symbolStorage{m_statementFactory}; ClangPathWatcher m_sourceWatcher{m_filePathCache}; FileStatusCache m_fileStatusCache{m_filePathCache}; SymbolIndexer m_indexer{m_collector, diff --git a/src/tools/clangrefactoringbackend/source/symbolstorage.h b/src/tools/clangrefactoringbackend/source/symbolstorage.h index dccc8f06fbe..9a474d4e85a 100644 --- a/src/tools/clangrefactoringbackend/source/symbolstorage.h +++ b/src/tools/clangrefactoringbackend/source/symbolstorage.h @@ -45,10 +45,8 @@ class SymbolStorage final : public SymbolStorageInterface using Database = typename StatementFactory::Database; public: - SymbolStorage(StatementFactory &statementFactory, - FilePathCachingInterface &filePathCache) - : m_statementFactory(statementFactory), - m_filePathCache(filePathCache) + SymbolStorage(StatementFactory &statementFactory) + : m_statementFactory(statementFactory) { } @@ -266,7 +264,6 @@ public: private: StatementFactory &m_statementFactory; - FilePathCachingInterface &m_filePathCache; }; } // namespace ClangBackEnd diff --git a/tests/unit/unittest/symbolstorage-test.cpp b/tests/unit/unittest/symbolstorage-test.cpp index 95fa71c2797..a0faff8dddb 100644 --- a/tests/unit/unittest/symbolstorage-test.cpp +++ b/tests/unit/unittest/symbolstorage-test.cpp @@ -58,7 +58,6 @@ using Storage = ClangBackEnd::SymbolStorage; class SymbolStorage : public testing::Test { protected: - MockFilePathCaching filePathCache; NiceMock mockDatabase; StatementFactory statementFactory{mockDatabase}; MockSqliteWriteStatement &insertSymbolsToNewSymbolsStatement = statementFactory.insertSymbolsToNewSymbolsStatement; @@ -95,7 +94,7 @@ protected: SourceLocationEntries sourceLocations{{1, {1, 3}, {42, 23}, SourceLocationKind::Declaration}, {2, {1, 4}, {7, 11}, SourceLocationKind::Definition}}; ClangBackEnd::ProjectPartArtefact artefact{"[\"-DFOO\"]", "{\"FOO\":\"1\"}", "[\"/includes\"]", 74}; - Storage storage{statementFactory, filePathCache}; + Storage storage{statementFactory}; }; TEST_F(SymbolStorage, CreateAndFillTemporaryLocationsTable)