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) {
|
void methodOkArguments(AstMethodSel* nodep, int minArg, int maxArg) {
|
||||||
int narg = 0;
|
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);
|
bool ok = (narg >= minArg) && (narg <= maxArg);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
nodep->v3error("The "<<narg<<" arguments passed to ."<<nodep->prettyName()
|
nodep->v3error("The "<<narg<<" arguments passed to ."<<nodep->prettyName()
|
||||||
|
|
@ -3903,16 +3906,18 @@ private:
|
||||||
//----------------------------------------------------------------------
|
//----------------------------------------------------------------------
|
||||||
// METHODS - data types
|
// METHODS - data types
|
||||||
|
|
||||||
AstNodeDType* moveChildDTypeEdit(AstNode* nodep) {
|
AstNodeDType* moveDTypeEdit(AstNode* nodep, AstNodeDType* dtnodep) {
|
||||||
// DTypes at parse time get added as a childDType to some node types such as AstVars.
|
// DTypes at parse time get added as a e.g. childDType to some node types such as AstVars.
|
||||||
// We move them to global scope, so removing/changing a variable won't lose the dtype.
|
// Move type 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 moveDTypeEdit");
|
||||||
UASSERT_OBJ(dtnodep, nodep, "Caller should check for NULL before calling moveChild");
|
UINFO(9,"moveDTypeEdit "<<dtnodep<<endl);
|
||||||
UINFO(9,"moveChildDTypeEdit "<<dtnodep<<endl);
|
|
||||||
dtnodep->unlinkFrBack(); // Make non-child
|
dtnodep->unlinkFrBack(); // Make non-child
|
||||||
v3Global.rootp()->typeTablep()->addTypesp(dtnodep);
|
v3Global.rootp()->typeTablep()->addTypesp(dtnodep);
|
||||||
return dtnodep;
|
return dtnodep;
|
||||||
}
|
}
|
||||||
|
AstNodeDType* moveChildDTypeEdit(AstNode* nodep) {
|
||||||
|
return moveDTypeEdit(nodep, nodep->getChildDTypep());
|
||||||
|
}
|
||||||
AstNodeDType* iterateEditDTypep(AstNode* parentp, AstNodeDType* nodep) {
|
AstNodeDType* iterateEditDTypep(AstNode* parentp, AstNodeDType* nodep) {
|
||||||
// Iterate into a data type to resolve that type. This process
|
// Iterate into a data type to resolve that type. This process
|
||||||
// may eventually create a new data type, but not today
|
// 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); }
|
yaINTNUM { $$ = new AstConst($<fl>1,*$1); }
|
||||||
| yaFLOATNUM { $$ = new AstConst($<fl>1,AstConst::RealDouble(),$1); }
|
| yaFLOATNUM { $$ = new AstConst($<fl>1,AstConst::RealDouble(),$1); }
|
||||||
| yaID__ETC { $$ = new AstText($<fl>1,*$1); }
|
| yaID__ETC { $$ = new AstText($<fl>1,*$1); }
|
||||||
|
| strAsInt { $$ = $1; }
|
||||||
;
|
;
|
||||||
|
|
||||||
assignment_pattern<patternp>: // ==IEEE: assignment_pattern
|
assignment_pattern<patternp>: // ==IEEE: assignment_pattern
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue