mirror of
https://github.com/verilator/verilator.git
synced 2025-01-24 15:24:04 +00:00
Internals: Misc code cleanups. No functional change.
This commit is contained in:
parent
d56179df17
commit
db6e5ce7cf
@ -239,7 +239,7 @@ AstNode* AstNode::addNext(AstNode* newp) {
|
||||
UASSERT(newp,"Null item passed to addNext\n");
|
||||
this->debugTreeChange("-addNextThs: ", __LINE__, false);
|
||||
newp->debugTreeChange("-addNextNew: ", __LINE__, true);
|
||||
if (this == NULL) {
|
||||
if (!this) {
|
||||
return (newp);
|
||||
} else {
|
||||
// Find end of old list
|
||||
@ -754,7 +754,6 @@ void AstNode::iterateAndNext(AstNVisitor& v, AstNUser* vup) {
|
||||
// This is a very hot function
|
||||
// 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!
|
||||
// if (!this) return; // Part of for()
|
||||
// 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.
|
||||
AstNode* nodep=this;
|
||||
|
@ -110,7 +110,7 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
||||
const char *ln = textp;
|
||||
while (*textp && !isspace(*textp)) textp++;
|
||||
if (isdigit(*ln)) {
|
||||
this->lineno(atoi(ln));
|
||||
lineno(atoi(ln));
|
||||
}
|
||||
while (*textp && (isspace(*textp) || *textp=='"')) textp++;
|
||||
|
||||
@ -120,7 +120,7 @@ void FileLine::lineDirective(const char* textp, int& enterExitRef) {
|
||||
if (textp != fn) {
|
||||
string strfn = fn;
|
||||
strfn = strfn.substr(0, textp-fn);
|
||||
this->filename(strfn);
|
||||
filename(strfn);
|
||||
}
|
||||
|
||||
// Grab level
|
||||
@ -229,7 +229,7 @@ void FileLine::modifyStateInherit(const FileLine* fromp) {
|
||||
for (int codei=V3ErrorCode::EC_MIN; codei<V3ErrorCode::_ENUM_MAX; codei++) {
|
||||
V3ErrorCode code = (V3ErrorCode)codei;
|
||||
if (fromp->warnIsOff(code)) {
|
||||
this->warnOff(code, true);
|
||||
warnOff(code, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -246,7 +246,7 @@ void FileLine::v3errorEnd(ostringstream& str) {
|
||||
}
|
||||
|
||||
string FileLine::warnMore() const {
|
||||
if (this && m_lineno) {
|
||||
if (m_lineno) {
|
||||
return V3Error::warnMore()+ascii()+": ";
|
||||
} else {
|
||||
return V3Error::warnMore();
|
||||
|
@ -2110,7 +2110,7 @@ private:
|
||||
taskp->dpiExport(true);
|
||||
if (nodep->cname()!="") taskp->cname(nodep->cname());
|
||||
}
|
||||
nodep->unlinkFrBack()->deleteTree();
|
||||
nodep->unlinkFrBack()->deleteTree(); VL_DANGLING(nodep);
|
||||
}
|
||||
virtual void visit(AstPackageImport* nodep, AstNUser*) {
|
||||
// No longer needed
|
||||
|
Loading…
Reference in New Issue
Block a user