From 9af84c71f5e22fd6ced75b0b4e44a9d3f7b27de1 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sun, 7 Jul 2019 09:01:36 -0400 Subject: [PATCH] Internals: More UASSERT_OBJ conversions. No functional change intended. --- src/V3AstNodes.cpp | 4 ++-- src/V3AstNodes.h | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 83a2024fc..d8851fa5b 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -215,8 +215,8 @@ string AstVar::verilogKwd() const { } string AstVar::vlArgType(bool named, bool forReturn, bool forFunc) const { - if (forReturn) named = false; - if (forReturn) v3fatalSrc("verilator internal data is never passed as return, but as first argument"); + UASSERT_OBJ(!forReturn, this, + "Internal data is never passed as return, but as first argument"); string otype; AstBasicDType* bdtypep = basicp(); bool strtype = bdtypep && bdtypep->keyword()==AstBasicDTypeKwd::STRING; diff --git a/src/V3AstNodes.h b/src/V3AstNodes.h index e6de7fa76..b459d85ff 100644 --- a/src/V3AstNodes.h +++ b/src/V3AstNodes.h @@ -951,8 +951,8 @@ class AstSelBit : public AstNodePreSel { public: AstSelBit(FileLine* fl, AstNode* fromp, AstNode* bitp) :AstNodePreSel(fl, fromp, bitp, NULL) { - if (v3Global.assertDTypesResolved()) { v3fatalSrc("not coded to create after dtypes resolved"); } - } + UASSERT_OBJ(!v3Global.assertDTypesResolved(), this, + "not coded to create after dtypes resolved"); } ASTNODE_NODE_FUNCS(SelBit) AstNode* bitp() const { return rhsp(); } }; @@ -3860,8 +3860,8 @@ class AstSigned : public AstNodeUniop { // $signed(lhs) public: AstSigned(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) { - if (v3Global.assertDTypesResolved()) { v3fatalSrc("not coded to create after dtypes resolved"); } - } + UASSERT_OBJ(!v3Global.assertDTypesResolved(), this, + "not coded to create after dtypes resolved"); } ASTNODE_NODE_FUNCS(Signed) virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opAssign(lhs); out.isSigned(false); } virtual string emitVerilog() { return "%f$signed(%l)"; } @@ -3875,8 +3875,8 @@ class AstUnsigned : public AstNodeUniop { // $unsigned(lhs) public: AstUnsigned(FileLine* fl, AstNode* lhsp) : AstNodeUniop(fl, lhsp) { - if (v3Global.assertDTypesResolved()) { v3fatalSrc("not coded to create after dtypes resolved"); } - } + UASSERT_OBJ(!v3Global.assertDTypesResolved(), this, + "not coded to create after dtypes resolved"); } ASTNODE_NODE_FUNCS(Unsigned) virtual void numberOperate(V3Number& out, const V3Number& lhs) { out.opAssign(lhs); out.isSigned(false); } virtual string emitVerilog() { return "%f$unsigned(%l)"; }