forked from github/verilator
Internals: Add VNUser::toPtr(). No functional change is intended.
This commit is contained in:
parent
e1404f0f16
commit
f98dce10db
@ -1136,10 +1136,11 @@ public:
|
|||||||
explicit VNUser(void* p) { m_u.up = p; }
|
explicit VNUser(void* p) { m_u.up = p; }
|
||||||
~VNUser() = default;
|
~VNUser() = default;
|
||||||
// Casters
|
// Casters
|
||||||
WidthVP* c() const { return reinterpret_cast<WidthVP*>(m_u.up); }
|
template <typename T> T* toPtr() const { return reinterpret_cast<T*>(m_u.up); }
|
||||||
VSymEnt* toSymEnt() const { return reinterpret_cast<VSymEnt*>(m_u.up); }
|
WidthVP* c() const { return toPtr<WidthVP>(); }
|
||||||
AstNode* toNodep() const { return reinterpret_cast<AstNode*>(m_u.up); }
|
VSymEnt* toSymEnt() const { return toPtr<VSymEnt>(); }
|
||||||
V3GraphVertex* toGraphVertex() const { return reinterpret_cast<V3GraphVertex*>(m_u.up); }
|
AstNode* toNodep() const { return toPtr<AstNode>(); }
|
||||||
|
V3GraphVertex* toGraphVertex() const { return toPtr<V3GraphVertex>(); }
|
||||||
int toInt() const { return m_u.ui; }
|
int toInt() const { return m_u.ui; }
|
||||||
static VNUser fromInt(int i) { return VNUser(i); }
|
static VNUser fromInt(int i) { return VNUser(i); }
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user