Internals: Use runtime type info instead of dynamic_cast for faster graph type checks (#4397)

This commit is contained in:
Krzysztof Bieganski
2023-08-31 18:00:53 -04:00
committed by GitHub
parent 96ee81fa3f
commit ffbbd438ae
22 changed files with 390 additions and 143 deletions
+2
View File
@@ -32,6 +32,7 @@ VL_DEFINE_DEBUG_FUNCTIONS;
// Break the minimal number of backward edges to make the graph acyclic
class GraphAcycVertex final : public V3GraphVertex {
VL_RTTI_IMPL(GraphAcycVertex, V3GraphVertex)
// user() is used for various sub-algorithm pieces
V3GraphVertex* const m_origVertexp; // Pointer to first vertex this represents
protected:
@@ -56,6 +57,7 @@ public:
//--------------------------------------------------------------------
class GraphAcycEdge final : public V3GraphEdge {
VL_RTTI_IMPL(GraphAcycEdge, V3GraphEdge)
// userp() is always used to point to the head original graph edge
private:
using OrigEdgeList = std::list<V3GraphEdge*>; // List of orig edges, see also GraphAcyc's decl