summaryrefslogtreecommitdiff
path: root/src/tools
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/tools
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/tools')
-rw-r--r--src/tools/clangpchmanagerbackend/source/sourceentry.h22
-rw-r--r--src/tools/clangrefactoringbackend/source/clangquery.cpp2
2 files changed, 20 insertions, 4 deletions
diff --git a/src/tools/clangpchmanagerbackend/source/sourceentry.h b/src/tools/clangpchmanagerbackend/source/sourceentry.h
index 2e0646b987..2a5e4ba06f 100644
--- a/src/tools/clangpchmanagerbackend/source/sourceentry.h
+++ b/src/tools/clangpchmanagerbackend/source/sourceentry.h
@@ -31,7 +31,7 @@
namespace ClangBackEnd {
-enum SourceType : unsigned char
+enum class SourceType : unsigned char
{
Any,
TopInclude,
@@ -56,7 +56,21 @@ public:
class SourceEntry
{
+ using int64 = long long;
public:
+ SourceEntry(int sourceId, int64 lastModified, int sourceType)
+ : lastModified(lastModified),
+ sourceId(sourceId),
+ sourceType(static_cast<SourceType>(sourceType))
+
+ {}
+
+ SourceEntry(FilePathId sourceId, SourceType sourceType, TimeStamp lastModified)
+ : lastModified(lastModified),
+ sourceId(sourceId),
+ sourceType(sourceType)
+ {}
+
friend
bool operator<(SourceEntry first, SourceEntry second)
{
@@ -66,13 +80,15 @@ public:
friend
bool operator==(SourceEntry first, SourceEntry second)
{
- return first.sourceId == second.sourceId;
+ return first.sourceId == second.sourceId
+ && first.sourceType == second.sourceType
+ && first.lastModified == second.lastModified ;
}
public:
+ TimeStamp lastModified;
FilePathId sourceId;
SourceType sourceType = SourceType::Any;
- TimeStamp lastModified;
};
using SourceEntries = std::vector<SourceEntry>;
diff --git a/src/tools/clangrefactoringbackend/source/clangquery.cpp b/src/tools/clangrefactoringbackend/source/clangquery.cpp
index 1524e36da5..21ebeb8367 100644
--- a/src/tools/clangrefactoringbackend/source/clangquery.cpp
+++ b/src/tools/clangrefactoringbackend/source/clangquery.cpp
@@ -101,7 +101,7 @@ namespace {
V2::SourceRangeContainer convertToContainer(const clang::ast_matchers::dynamic::SourceRange sourceRange)
{
- return V2::SourceRangeContainer({1, 0},
+ return V2::SourceRangeContainer(0,
sourceRange.Start.Line,
sourceRange.Start.Column,
0,