forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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};
|
||||
};
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user