aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/depscanner.cpp
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2016-12-12 13:10:33 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2016-12-19 15:07:34 +0000
commit21e82bbbe316f582ee11c8996e24e402f9342606 (patch)
treedf3ac27e814e83f0cf914944bcf3f354fad64638 /src/lib/corelib/buildgraph/depscanner.cpp
parentd3b1bf682181277e03299b1567631e144df12a67 (diff)
Merge the C/C++ include scanners
We had one scanner for every type of file in the C family, all of which collected the same set of includes, but under a different entry in the scanner cache. Thus, lots of header files were unnecessarily re-scanned. We fix this by making the scanner plugins declare a *list* of tags they can handle and passing the currently active tags in the open() function. ========== Performance data for Rule Execution ========== Old instruction count: 3775190973 New instruction count: 3441085735 Relative change: -9 % Old peak memory usage: 18174216 Bytes New peak memory usage: 17307600 Bytes Relative change: -5 % Change-Id: I222d1ec4bbfbc06ecd8c81faa55a500bc0da1ee6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/depscanner.cpp')
-rw-r--r--src/lib/corelib/buildgraph/depscanner.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/corelib/buildgraph/depscanner.cpp b/src/lib/corelib/buildgraph/depscanner.cpp
index d88759f3b..824c3cf75 100644
--- a/src/lib/corelib/buildgraph/depscanner.cpp
+++ b/src/lib/corelib/buildgraph/depscanner.cpp
@@ -88,12 +88,13 @@ QStringList PluginDependencyScanner::collectSearchPaths(Artifact *artifact)
}
}
-QStringList PluginDependencyScanner::collectDependencies(FileResourceBase *file)
+QStringList PluginDependencyScanner::collectDependencies(FileResourceBase *file,
+ const char *fileTags)
{
QSet<QString> result;
QString baseDirOfInFilePath = file->dirPath();
const QString &filepath = file->filePath();
- void *scannerHandle = m_plugin->open(filepath.utf16(), ScanForDependenciesFlag);
+ void *scannerHandle = m_plugin->open(filepath.utf16(), fileTags, ScanForDependenciesFlag);
if (!scannerHandle)
return QStringList();
forever {
@@ -150,8 +151,9 @@ QStringList UserDependencyScanner::collectSearchPaths(Artifact *artifact)
return evaluate(artifact, m_scanner->searchPathsScript);
}
-QStringList UserDependencyScanner::collectDependencies(FileResourceBase *file)
+QStringList UserDependencyScanner::collectDependencies(FileResourceBase *file, const char *fileTags)
{
+ Q_UNUSED(fileTags);
// ### support user dependency scanners for file deps
Artifact *artifact = dynamic_cast<Artifact *>(file);
if (!artifact)