diff --git a/src/V3Error.h b/src/V3Error.h index 79870b011..f03506c62 100644 --- a/src/V3Error.h +++ b/src/V3Error.h @@ -277,6 +277,10 @@ inline void v3errorEndFatal(std::ostringstream& sstr) { V3Error::v3errorEnd(sstr #define v3fatal(msg) v3warnCodeFatal(V3ErrorCode::EC_FATAL, msg) // Use this instead of fatal() to mention the source code line. #define v3fatalSrc(msg) v3warnCodeFatal(V3ErrorCode::EC_FATALSRC, __FILE__<<":"<=(level))) { cout<<"- "<=(level))) { cout<v3fatalSrc("Loops detected in graph: "< #include +class FileLine; class V3Graph; class V3GraphVertex; class V3GraphEdge; @@ -171,7 +172,7 @@ public: static void selfTest(); // CALLBACKS - virtual void loopsMessageCb(V3GraphVertex* vertexp) { v3fatalSrc("Loops detected in graph: "<verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) { if (DfaVertex* vvertexp = dynamic_cast(vertexp)) { if (vvertexp->start()) { - if (startp) v3fatalSrc("Multiple start points in NFA graph"); + if (startp) vertexp->v3fatalSrc("Multiple start points in NFA graph"); startp = vvertexp; } } else { - v3fatalSrc("Non DfaVertex in DfaGraph"); + vertexp->v3fatalSrc("Non DfaVertex in DfaGraph"); } } if (!startp) v3fatalSrc("No start point in NFA graph"); @@ -116,7 +116,9 @@ private: DfaVertex* nfaStatep = static_cast(dfaEdgep->top()); hash ^= hashVertex(nfaStatep); if (debug()) { - if (nfaStatep->user()==m_step) v3fatalSrc("DFA state points to duplicate NFA state."); + if (nfaStatep->user()==m_step) { + nfaStatep->v3fatalSrc("DFA state points to duplicate NFA state."); + } nfaStatep->user(m_step); } } @@ -444,7 +446,7 @@ private: vertexp->user(1); } else { // If ever remove this, need dyn cast below - v3fatalSrc("Non DfaVertex in dfa graph"); + vertexp->v3fatalSrc("Non DfaVertex in dfa graph"); } } diff --git a/src/V3Order.cpp b/src/V3Order.cpp index af604e891..a52c0bb55 100644 --- a/src/V3Order.cpp +++ b/src/V3Order.cpp @@ -1239,7 +1239,9 @@ inline void OrderMoveDomScope::ready(OrderVisitor* ovp) { // Mark one vertex as finished, remove from ready list if done inline void OrderMoveDomScope::movedVertex(OrderVisitor* ovp, OrderMoveVertex* vertexp) { - UASSERT(m_onReadyList, "Moving vertex from ready when nothing was on que as ready."); + if (!m_onReadyList) { + vertexp->v3fatalSrc("Moving vertex from ready when nothing was on que as ready."); + } if (m_readyVertices.empty()) { // Else more work to get to later m_onReadyList = false; m_readyDomScopeE.unlink(ovp->m_pomReadyDomScope, this); @@ -1306,7 +1308,9 @@ void OrderVisitor::processInputsOutIterate(OrderEitherVertex* vertexp, VertexVec // First make sure input path is fully recursed processInputsInIterate(vertexp, todoVec); // Propagate PrimaryIn through simple assignments - if (!vertexp->isFromInput()) v3fatalSrc("processInputsOutIterate only for input marked vertexes"); + if (!vertexp->isFromInput()) { + vertexp->v3fatalSrc("processInputsOutIterate only for input marked vertexes"); + } vertexp->user(3); // out-edges processed { @@ -1653,7 +1657,9 @@ void OrderVisitor::processMoveDoneOne(OrderMoveVertex* vertexp) { } void OrderVisitor::processMoveOne(OrderMoveVertex* vertexp, OrderMoveDomScope* domScopep, int level) { - UASSERT(vertexp->domScopep() == domScopep, "Domain mismatch; list misbuilt?"); + if (vertexp->domScopep() != domScopep) { + vertexp->v3fatalSrc("Domain mismatch; list misbuilt?"); + } const OrderLogicVertex* lvertexp = vertexp->logicp(); const AstScope* scopep = lvertexp->scopep(); UINFO(5," POSmove l"<