From f98dce10db5923c743ebe7e0392049f1dd39f2ab Mon Sep 17 00:00:00 2001 From: Yutetsu TAKATSUKASA Date: Sun, 17 Jan 2021 13:55:47 +0900 Subject: [PATCH] Internals: Add VNUser::toPtr(). No functional change is intended. --- src/V3Ast.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/V3Ast.h b/src/V3Ast.h index 2295ff743..3dac483ea 100644 --- a/src/V3Ast.h +++ b/src/V3Ast.h @@ -1136,10 +1136,11 @@ public: explicit VNUser(void* p) { m_u.up = p; } ~VNUser() = default; // Casters - WidthVP* c() const { return reinterpret_cast(m_u.up); } - VSymEnt* toSymEnt() const { return reinterpret_cast(m_u.up); } - AstNode* toNodep() const { return reinterpret_cast(m_u.up); } - V3GraphVertex* toGraphVertex() const { return reinterpret_cast(m_u.up); } + template T* toPtr() const { return reinterpret_cast(m_u.up); } + WidthVP* c() const { return toPtr(); } + VSymEnt* toSymEnt() const { return toPtr(); } + AstNode* toNodep() const { return toPtr(); } + V3GraphVertex* toGraphVertex() const { return toPtr(); } int toInt() const { return m_u.ui; } static VNUser fromInt(int i) { return VNUser(i); } };