diff --git a/src/V3Fork.cpp b/src/V3Fork.cpp index 31fdca34b..0cfc7dd00 100644 --- a/src/V3Fork.cpp +++ b/src/V3Fork.cpp @@ -247,7 +247,7 @@ private: } else if (AstNodeFTask* taskp = VN_CAST(m_procp, NodeFTask)) { stmtsp = taskp->stmtsp(); } else { - v3fatal("m_procp is not a begin block or a procedure"); + m_procp->v3fatalSrc("m_procp is not a begin block or a procedure"); } return stmtsp; } diff --git a/src/V3Graph.cpp b/src/V3Graph.cpp index b2c3c4756..9eca82238 100644 --- a/src/V3Graph.cpp +++ b/src/V3Graph.cpp @@ -92,26 +92,6 @@ void V3GraphVertex::rerouteEdges(V3Graph* graphp) { bool V3GraphVertex::inSize1() const { return !inEmpty() && !inBeginp()->inNextp(); } bool V3GraphVertex::outSize1() const { return !outEmpty() && !outBeginp()->outNextp(); } -uint32_t V3GraphVertex::inHash() const { - // We want the same hash ignoring the order of edges. - // So we need an associative operator, like XOR. - // However with XOR multiple edges to the same source will cancel out, - // so we use ADD. (Generally call this only after removing duplicates though) - uint32_t hash = 0; - for (V3GraphEdge* edgep = this->inBeginp(); edgep; edgep = edgep->inNextp()) { - hash += cvtToHash(edgep->fromp()); - } - return hash; -} - -uint32_t V3GraphVertex::outHash() const { - uint32_t hash = 0; - for (V3GraphEdge* edgep = this->outBeginp(); edgep; edgep = edgep->outNextp()) { - hash += cvtToHash(edgep->top()); - } - return hash; -} - V3GraphEdge* V3GraphVertex::findConnectingEdgep(GraphWay way, const V3GraphVertex* waywardp) { // O(edges) linear search. Searches search both nodes' edge lists in // parallel. The lists probably aren't _both_ huge, so this is diff --git a/src/V3Graph.h b/src/V3Graph.h index 2d277826c..84dd4f85f 100644 --- a/src/V3Graph.h +++ b/src/V3Graph.h @@ -276,11 +276,9 @@ public: V3GraphEdge* inBeginp() const { return m_ins.begin(); } bool inEmpty() const { return inBeginp() == nullptr; } bool inSize1() const; - uint32_t inHash() const; V3GraphEdge* outBeginp() const { return m_outs.begin(); } bool outEmpty() const { return outBeginp() == nullptr; } bool outSize1() const; - uint32_t outHash() const; V3GraphEdge* beginp(GraphWay way) const { return way.forward() ? outBeginp() : inBeginp(); } // METHODS /// Error reporting diff --git a/src/V3PreLex.l b/src/V3PreLex.l index 4524374b4..1daee9a31 100644 --- a/src/V3PreLex.l +++ b/src/V3PreLex.l @@ -501,11 +501,11 @@ size_t V3PreLex::inputToLex(char* buf, size_t max_size) { // become a stale invalid pointer. // VPreStream* streamp = curStreamp(); - if (debug() >= 10) { + if (debug() >= 10) { // LCOV_EXCL_START cout << "- pp:inputToLex ITL s=" << max_size << " bs=" << streamp->m_buffers.size() << endl; dumpStack(); - } + } // LCOV_EXCL_STOP // For testing, use really small chunks // if (max_size > 13) max_size=13; again: @@ -696,16 +696,16 @@ void V3PreLex::warnBackslashSpace() { BSSPACE, "Backslash followed by whitespace, perhaps the whitespace is accidental?"); } -void V3PreLex::dumpSummary() { +void V3PreLex::dumpSummary() { // LCOV_EXCL_START cout << "- pp::dumpSummary curBuf=" << cvtToHex(currentBuffer()); #ifdef FLEX_DEBUG // Else peeking at internals may cause portability issues ssize_t left = (yy_n_chars - (yy_c_buf_p - currentBuffer()->yy_ch_buf)); cout << " left=" << std::dec << left; #endif cout << endl; -} +} // LCOV_EXCL_STOP -void V3PreLex::dumpStack() { +void V3PreLex::dumpStack() { // LCOV_EXCL_START // For debug use dumpSummary(); std::stack tmpstack = LEXP->m_streampStack; @@ -717,7 +717,7 @@ void V3PreLex::dumpStack() { << (streamp->m_eof ? " [EOF]" : "") << (streamp->m_file ? " [FILE]" : "") << endl; tmpstack.pop(); } -} +} // LCOV_EXCL_STOP string V3PreLex::cleanDbgStrg(const string& in) { string result = in; diff --git a/test_regress/t/t_dist_warn_coverage.pl b/test_regress/t/t_dist_warn_coverage.pl index 2a69f2402..25b6be901 100755 --- a/test_regress/t/t_dist_warn_coverage.pl +++ b/test_regress/t/t_dist_warn_coverage.pl @@ -101,7 +101,6 @@ foreach my $s ( 'Unsupported: no_inline for tasks', 'Unsupported: static cast to ', 'Unsupported: super', - '\'foreach\' loop variable expects simple variable name', ) { $Suppressed{$s} = 1; } if (!-r "$root/.git") { diff --git a/test_regress/t/t_foreach_bad.out b/test_regress/t/t_foreach_bad.out index 799c765f5..2b09380d7 100644 --- a/test_regress/t/t_foreach_bad.out +++ b/test_regress/t/t_foreach_bad.out @@ -1,4 +1,7 @@ %Error: t/t_foreach_bad.v:14:7: Syntax error; foreach missing bracketed loop variable (IEEE 1800-2017 12.7.3) 14 | foreach (array); | ^~~~~~~ +%Error: t/t_foreach_bad.v:18:23: 'foreach' loop variable expects simple variable name + 18 | foreach (array[a.b]); + | ^ %Error: Exiting due to diff --git a/test_regress/t/t_foreach_bad.v b/test_regress/t/t_foreach_bad.v index be94993af..ac2d7bd68 100644 --- a/test_regress/t/t_foreach_bad.v +++ b/test_regress/t/t_foreach_bad.v @@ -15,6 +15,8 @@ module t (/*AUTOARG*/); foreach (array.array[a]); // not supported + foreach (array[a.b]); // no index + $write("*-* All Finished *-*\n"); $finish; end