aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/corelib/buildgraph/artifact.h
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@qt.io>2017-12-04 11:52:12 +0100
committerChristian Kandeler <christian.kandeler@qt.io>2017-12-07 09:56:53 +0000
commit88b9e4e3ba5e5a72d7c614126c853de2a55af1a0 (patch)
tree9da8302df5696f20061a6078816e72f0ba563699 /src/lib/corelib/buildgraph/artifact.h
parent281f8519f4bde3dcf59c23fa9c7e1b2739506c74 (diff)
Get rid of all remaining dynamic_casts
This speeds up rule execution by another 2%. Change-Id: If819144f2c01bd243ec98f7a6d050bc5faa2b02c Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Diffstat (limited to 'src/lib/corelib/buildgraph/artifact.h')
-rw-r--r--src/lib/corelib/buildgraph/artifact.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/lib/corelib/buildgraph/artifact.h b/src/lib/corelib/buildgraph/artifact.h
index 9d01fc384..97f881e81 100644
--- a/src/lib/corelib/buildgraph/artifact.h
+++ b/src/lib/corelib/buildgraph/artifact.h
@@ -44,6 +44,7 @@
#include "buildgraphnode.h"
#include "forward_decls.h"
#include <language/filetags.h>
+#include <tools/dynamictypecheck.h>
#include <tools/filetime.h>
#include <tools/set.h>
@@ -122,6 +123,11 @@ template<> inline const void *uniqueAddress(const Artifact *a)
return static_cast<const BuildGraphNode *>(a);
}
+template<> inline bool hasDynamicType<Artifact>(const BuildGraphNode *n)
+{
+ return n->type() == BuildGraphNode::ArtifactNodeType;
+}
+
// debugging helper
inline QString toString(Artifact::ArtifactType t)
{