From bf3f111ca483485c512e91b96da0d54daea56548 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Sat, 16 Dec 2017 10:07:15 -0500 Subject: [PATCH] Internals: Move VLVF flags to common function. No functional change. --- src/V3AstNodes.cpp | 13 +++++++++---- src/V3EmitCSyms.cpp | 2 -- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/V3AstNodes.cpp b/src/V3AstNodes.cpp index 1803ad3be..4d86f3106 100644 --- a/src/V3AstNodes.cpp +++ b/src/V3AstNodes.cpp @@ -275,15 +275,20 @@ string AstVar::vlEnumType() const { } string AstVar::vlEnumDir() const { + string out; if (isInout()) { - return "VLVD_INOUT"; + out = "VLVD_INOUT"; } else if (isInOnly()) { - return "VLVD_IN"; + out = "VLVD_IN"; } else if (isOutOnly()) { - return "VLVD_OUT"; + out = "VLVD_OUT"; } else { - return "VLVD_NODIR"; + out = "VLVD_NODIR"; } + // + if (isSigUserRWPublic()) out += "|VLVF_PUB_RW"; + else if (isSigUserRdPublic()) out += "|VLVF_PUB_RD"; + return out; } string AstVar::cPubArgType(bool named, bool forReturn) const { diff --git a/src/V3EmitCSyms.cpp b/src/V3EmitCSyms.cpp index 34a7fc5a1..6d3a12b88 100644 --- a/src/V3EmitCSyms.cpp +++ b/src/V3EmitCSyms.cpp @@ -509,8 +509,6 @@ void EmitCSyms::emitSymImp() { puts(varp->vlEnumType()); // VLVT_UINT32 etc puts(","); puts(varp->vlEnumDir()); // VLVD_IN etc - if (varp->isSigUserRWPublic()) puts("|VLVF_PUB_RW"); - else if (varp->isSigUserRdPublic()) puts("|VLVF_PUB_RD"); puts(","); puts(cvtToStr(pdim+udim)); puts(bounds);