void nameCheck(AstNode* nodep) {
	// Prevent GCC compile time error; name check all things that reach C++ code
	if (nodep->name() != "") {
	    string rsvd = m_words.isKeyword(nodep->name());
	    if (rsvd != "") {
		// Generally V3Name should find all of these and throw SYMRSVDWORD.
		// We'll still check here because the compiler errors resulting if we miss this warning are SO nasty
		nodep->v3error("Symbol matching "+rsvd+" reserved word reached emitter, should have hit SYMRSVDWORD: '"<<nodep->prettyName()<<"'");
	    }
	}
    }
Exemple #2
0
    void rename(AstNode* nodep, bool addPvt) {
	if (!nodep->user1()) {  // Not already done
	    if (addPvt) {
		string newname = (string)"__PVT__"+nodep->name();
		nodep->name(newname);
	    } else {
		string rsvd = m_words.isKeyword(nodep->name());
		if (rsvd != "") {
		    nodep->v3warn(SYMRSVDWORD,"Symbol matches "+rsvd+": '"<<nodep->prettyName()<<"'");
		    string newname = (string)"__SYM__"+nodep->name();
		    nodep->name(newname);
		}
	    }
	    nodep->user1(1);
	}
    }