forked from qt-creator/qt-creator
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user