From 6eb620238b31af81bb097260afb53bcac1054221 Mon Sep 17 00:00:00 2001 From: Marco Bubke Date: Tue, 6 Nov 2018 19:02:00 +0100 Subject: Clang: Refactor FilePathId We don't need the directory id any more. It's not used widely any way. Task-number: QTCREATORBUG-21443 Change-Id: Ia95ea4c72fe9530ac56262f61f17faca04d313ba Reviewed-by: Ivan Donchevskii --- src/plugins/clangrefactoring/querysqlitestatementfactory.h | 4 ++-- src/plugins/clangrefactoring/sourcelocations.h | 4 ++-- src/plugins/clangrefactoring/symbolquery.h | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/plugins/clangrefactoring') diff --git a/src/plugins/clangrefactoring/querysqlitestatementfactory.h b/src/plugins/clangrefactoring/querysqlitestatementfactory.h index 21a1f022ec..14fc27149d 100644 --- a/src/plugins/clangrefactoring/querysqlitestatementfactory.h +++ b/src/plugins/clangrefactoring/querysqlitestatementfactory.h @@ -40,7 +40,7 @@ public: {} Database &database; ReadStatement selectLocationsForSymbolLocation{ - "SELECT directoryId, sourceId, line, column FROM locations JOIN sources USING(sourceId) WHERE symbolId = " + "SELECT sourceId, line, column FROM locations WHERE symbolId = " " (SELECT symbolId FROM locations WHERE sourceId=? AND line=? AND column=?) " "ORDER BY sourceId, line, column", database}; @@ -59,7 +59,7 @@ public: "SELECT symbolId, symbolName, signature FROM symbols WHERE symbolKind IN (?,?,?) AND symbolName LIKE ?", database}; ReadStatement selectLocationOfSymbol{ - "SELECT (SELECT directoryId FROM sources WHERE sourceId = l.sourceId), sourceId, line, column FROM locations AS l WHERE symbolId = ? AND locationKind = ?", + "SELECT sourceId, line, column FROM locations AS l WHERE symbolId = ? AND locationKind = ?", database}; }; diff --git a/src/plugins/clangrefactoring/sourcelocations.h b/src/plugins/clangrefactoring/sourcelocations.h index 9766a779b5..80fc0d89c0 100644 --- a/src/plugins/clangrefactoring/sourcelocations.h +++ b/src/plugins/clangrefactoring/sourcelocations.h @@ -45,8 +45,8 @@ public: SourceLocation(ClangBackEnd::FilePathId filePathId, int line, int column) : filePathId{filePathId}, lineColumn{line, column} {} - SourceLocation(int directoryId, int sourceId, int line, int column) - : filePathId{directoryId, sourceId}, lineColumn{line, column} + SourceLocation(int sourceId, int line, int column) + : filePathId{sourceId}, lineColumn{line, column} {} friend bool operator==(SourceLocation first, SourceLocation second) diff --git a/src/plugins/clangrefactoring/symbolquery.h b/src/plugins/clangrefactoring/symbolquery.h index 507d032f06..b5a46ab7e6 100644 --- a/src/plugins/clangrefactoring/symbolquery.h +++ b/src/plugins/clangrefactoring/symbolquery.h @@ -55,7 +55,7 @@ public: const std::size_t reserveSize = 128; - return locationsStatement.template values(reserveSize, + return locationsStatement.template values(reserveSize, filePathId.filePathId, line, utf8Column); @@ -120,7 +120,7 @@ public: { ReadStatement &statement = m_statementFactory.selectLocationOfSymbol; - return statement.template value(symbolId, int(kind)); + return statement.template value(symbolId, int(kind)); } private: StatementFactory &m_statementFactory; -- cgit v1.2.1