summaryrefslogtreecommitdiff
path: root/src/plugins/clangrefactoring
diff options
context:
space:
mode:
authorMarco Bubke <marco.bubke@qt.io>2018-11-06 19:02:00 +0100
committerMarco Bubke <marco.bubke@qt.io>2018-11-08 12:51:15 +0000
commit6eb620238b31af81bb097260afb53bcac1054221 (patch)
tree7c4842e2e8a3d0630a72da993d45344f677b1288 /src/plugins/clangrefactoring
parentd37ec2c1e511df19f48b4a621270df3e7135a731 (diff)
downloadqt-creator-6eb620238b31af81bb097260afb53bcac1054221.tar.gz
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 <ivan.donchevskii@qt.io>
Diffstat (limited to 'src/plugins/clangrefactoring')
-rw-r--r--src/plugins/clangrefactoring/querysqlitestatementfactory.h4
-rw-r--r--src/plugins/clangrefactoring/sourcelocations.h4
-rw-r--r--src/plugins/clangrefactoring/symbolquery.h4
3 files changed, 6 insertions, 6 deletions
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<SourceLocation, 4>(reserveSize,
+ return locationsStatement.template values<SourceLocation, 3>(reserveSize,
filePathId.filePathId,
line,
utf8Column);
@@ -120,7 +120,7 @@ public:
{
ReadStatement &statement = m_statementFactory.selectLocationOfSymbol;
- return statement.template value<SourceLocation, 4>(symbolId, int(kind));
+ return statement.template value<SourceLocation, 3>(symbolId, int(kind));
}
private:
StatementFactory &m_statementFactory;