Clang: Add BuildDependencyCollector

IncludeCollector is renamed to BuildDependencyCollector. It is now
returning a BuildDependency instead of individual getter. The test coverage
is improved too.

Task-number: QTCREATORBUG-21379
Change-Id: Ifc2d1c40c85772cf498c21968de526f4408b6023
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
Marco Bubke
2018-11-12 19:27:51 +01:00
parent e11ff791f0
commit 64a3a130ac
56 changed files with 1135 additions and 813 deletions

View File

@@ -34,17 +34,26 @@ namespace ClangBackEnd {
class SourceDependency
{
public:
SourceDependency(FilePathId filePathId,
FilePathId dependencyFilePathId)
: filePathId(filePathId),
dependencyFilePathId(dependencyFilePathId)
SourceDependency(FilePathId filePathId, FilePathId dependencyFilePathId)
: filePathId(filePathId)
, dependencyFilePathId(dependencyFilePathId)
{}
friend
bool operator==(SourceDependency first, SourceDependency second)
friend bool operator==(SourceDependency first, SourceDependency second)
{
return first.filePathId == second.filePathId
&& first.dependencyFilePathId == second.dependencyFilePathId;
&& first.dependencyFilePathId == second.dependencyFilePathId;
}
friend bool operator!=(SourceDependency first, SourceDependency second)
{
return !(first == second);
}
friend bool operator<(SourceDependency first, SourceDependency second)
{
return std::tie(first.filePathId, first.dependencyFilePathId)
< std::tie(second.filePathId, second.dependencyFilePathId);
}
public:
@@ -53,4 +62,4 @@ public:
};
using SourceDependencies = std::vector<SourceDependency>;
}
} // namespace ClangBackEnd