From 04f68cbd994e32a875d10028ff7fc9e4418b57f3 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 13 Nov 2022 21:58:18 -0500 Subject: [PATCH] Internals: Spacing --- include/verilated_types.h | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/include/verilated_types.h b/include/verilated_types.h index 271de4f67..ef0611ac9 100644 --- a/include/verilated_types.h +++ b/include/verilated_types.h @@ -1079,6 +1079,7 @@ public: //=================================================================== // Represents the null pointer. Used for setting VlClassRef to null instead of // via nullptr_t, to prevent the implicit conversion of 0 to nullptr. + struct VlNull { operator bool() const { return false; } }; @@ -1178,18 +1179,6 @@ public: operator bool() const { return m_objp; } }; -#define VL_NEW(Class, ...) \ - VlClassRef { vlSymsp->__Vm_deleter, __VA_ARGS__ } - -#define VL_KEEP_THIS \ - VlClassRef::type> __Vthisref { this } - -template // T typically of type VlClassRef -inline T VL_NULL_CHECK(T t, const char* filename, int linenum) { - if (VL_UNLIKELY(!t)) Verilated::nullPointerError(filename, linenum); - return t; -} - template static inline bool VL_CAST_DYNAMIC(VlClassRef in, VlClassRef& outr) { VlClassRef casted = in.template dynamicCast(); @@ -1203,4 +1192,18 @@ static inline bool VL_CAST_DYNAMIC(VlClassRef in, VlClassRef& outr) { //====================================================================== +#define VL_NEW(Class, ...) \ + VlClassRef { vlSymsp->__Vm_deleter, __VA_ARGS__ } + +#define VL_KEEP_THIS \ + VlClassRef::type> __Vthisref { this } + +template // T typically of type VlClassRef +inline T VL_NULL_CHECK(T t, const char* filename, int linenum) { + if (VL_UNLIKELY(!t)) Verilated::nullPointerError(filename, linenum); + return t; +} + +//====================================================================== + #endif // Guard