mirror of
https://github.com/verilator/verilator.git
synced 2025-04-29 20:16:53 +00:00
Internals: Assert proper AstArgs in place.
This commit is contained in:
parent
2ff22d9050
commit
09ca4ce791
@ -1661,7 +1661,10 @@ private:
|
||||
}
|
||||
void methodOkArguments(AstMethodSel* nodep, int minArg, int maxArg) {
|
||||
int narg = 0;
|
||||
for (AstNode* argp = nodep->pinsp(); argp; argp = argp->nextp()) ++narg;
|
||||
for (AstNode* argp = nodep->pinsp(); argp; argp = argp->nextp()) {
|
||||
++narg;
|
||||
UASSERT_OBJ(VN_IS(argp, Arg), nodep, "Method arg without Arg type");
|
||||
}
|
||||
bool ok = (narg >= minArg) && (narg <= maxArg);
|
||||
if (!ok) {
|
||||
nodep->v3error("The "<<narg<<" arguments passed to ."<<nodep->prettyName()
|
||||
@ -3903,16 +3906,18 @@ private:
|
||||
//----------------------------------------------------------------------
|
||||
// METHODS - data types
|
||||
|
||||
AstNodeDType* moveChildDTypeEdit(AstNode* nodep) {
|
||||
// DTypes at parse time get added as a childDType to some node types such as AstVars.
|
||||
// We move them to global scope, so removing/changing a variable won't lose the dtype.
|
||||
AstNodeDType* dtnodep = nodep->getChildDTypep();
|
||||
UASSERT_OBJ(dtnodep, nodep, "Caller should check for NULL before calling moveChild");
|
||||
UINFO(9,"moveChildDTypeEdit "<<dtnodep<<endl);
|
||||
AstNodeDType* moveDTypeEdit(AstNode* nodep, AstNodeDType* dtnodep) {
|
||||
// DTypes at parse time get added as a e.g. childDType to some node types such as AstVars.
|
||||
// Move type to global scope, so removing/changing a variable won't lose the dtype.
|
||||
UASSERT_OBJ(dtnodep, nodep, "Caller should check for NULL before calling moveDTypeEdit");
|
||||
UINFO(9,"moveDTypeEdit "<<dtnodep<<endl);
|
||||
dtnodep->unlinkFrBack(); // Make non-child
|
||||
v3Global.rootp()->typeTablep()->addTypesp(dtnodep);
|
||||
return dtnodep;
|
||||
}
|
||||
AstNodeDType* moveChildDTypeEdit(AstNode* nodep) {
|
||||
return moveDTypeEdit(nodep, nodep->getChildDTypep());
|
||||
}
|
||||
AstNodeDType* iterateEditDTypep(AstNode* parentp, AstNodeDType* nodep) {
|
||||
// Iterate into a data type to resolve that type. This process
|
||||
// may eventually create a new data type, but not today
|
||||
|
@ -2732,6 +2732,7 @@ patternKey<nodep>: // IEEE: merge structure_pattern_key, array_pattern_key, ass
|
||||
yaINTNUM { $$ = new AstConst($<fl>1,*$1); }
|
||||
| yaFLOATNUM { $$ = new AstConst($<fl>1,AstConst::RealDouble(),$1); }
|
||||
| yaID__ETC { $$ = new AstText($<fl>1,*$1); }
|
||||
| strAsInt { $$ = $1; }
|
||||
;
|
||||
|
||||
assignment_pattern<patternp>: // ==IEEE: assignment_pattern
|
||||
|
Loading…
Reference in New Issue
Block a user