Internals: Misc code cleanups. No functional change.

This commit is contained in:
Wilson Snyder 2016-02-03 20:43:05 -05:00
parent d56179df17
commit db6e5ce7cf
3 changed files with 6 additions and 7 deletions

View File

@ -239,7 +239,7 @@ AstNode* AstNode::addNext(AstNode* newp) {
UASSERT(newp,"Null item passed to addNext\n"); UASSERT(newp,"Null item passed to addNext\n");
this->debugTreeChange("-addNextThs: ", __LINE__, false); this->debugTreeChange("-addNextThs: ", __LINE__, false);
newp->debugTreeChange("-addNextNew: ", __LINE__, true); newp->debugTreeChange("-addNextNew: ", __LINE__, true);
if (this == NULL) { if (!this) {
return (newp); return (newp);
} else { } else {
// Find end of old list // Find end of old list
@ -754,7 +754,6 @@ void AstNode::iterateAndNext(AstNVisitor& v, AstNUser* vup) {
// This is a very hot function // This is a very hot function
// IMPORTANT: If you replace a node that's the target of this iterator, // IMPORTANT: If you replace a node that's the target of this iterator,
// then the NEW node will be iterated on next, it isn't skipped! // then the NEW node will be iterated on next, it isn't skipped!
// if (!this) return; // Part of for()
// Future versions of this function may require the node to have a back to be iterated; // Future versions of this function may require the node to have a back to be iterated;
// there's no lower level reason yet though the back must exist. // there's no lower level reason yet though the back must exist.
AstNode* nodep=this; AstNode* nodep=this;

View File

@ -110,7 +110,7 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
const char *ln = textp; const char *ln = textp;
while (*textp && !isspace(*textp)) textp++; while (*textp && !isspace(*textp)) textp++;
if (isdigit(*ln)) { if (isdigit(*ln)) {
this->lineno(atoi(ln)); lineno(atoi(ln));
} }
while (*textp && (isspace(*textp) || *textp=='"')) textp++; while (*textp && (isspace(*textp) || *textp=='"')) textp++;
@ -120,7 +120,7 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
if (textp != fn) { if (textp != fn) {
string strfn = fn; string strfn = fn;
strfn = strfn.substr(0, textp-fn); strfn = strfn.substr(0, textp-fn);
this->filename(strfn); filename(strfn);
} }
// Grab level // Grab level
@ -229,7 +229,7 @@ void FileLine::modifyStateInherit(const FileLine* fromp) {
for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) { for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
V3ErrorCode code = (V3ErrorCode)codei; V3ErrorCode code = (V3ErrorCode)codei;
if (fromp->warnIsOff(code)) { if (fromp->warnIsOff(code)) {
this->warnOff(code, true); warnOff(code, true);
} }
} }
} }
@ -246,7 +246,7 @@ void FileLine::v3errorEnd(ostringstream& str) {
} }
string FileLine::warnMore() const { string FileLine::warnMore() const {
if (this && m_lineno) { if (m_lineno) {
return V3Error::warnMore()+ascii()+": "; return V3Error::warnMore()+ascii()+": ";
} else { } else {
return V3Error::warnMore(); return V3Error::warnMore();

View File

@ -2110,7 +2110,7 @@ private:
taskp->dpiExport(true); taskp->dpiExport(true);
if (nodep->cname()!="") taskp->cname(nodep->cname()); if (nodep->cname()!="") taskp->cname(nodep->cname());
} }
nodep->unlinkFrBack()->deleteTree(); nodep->unlinkFrBack()->deleteTree(); VL_DANGLING(nodep);
} }
virtual void visit(AstPackageImport* nodep, AstNUser*) { virtual void visit(AstPackageImport* nodep, AstNUser*) {
// No longer needed // No longer needed