mirror of
https://github.com/verilator/verilator.git
synced 2025-05-03 05:56:53 +00:00
Internals: Rename MethodCall. No functional change.
This commit is contained in:
parent
09ca4ce791
commit
39eeda50c6
@ -1114,25 +1114,25 @@ public:
|
||||
void fromp(AstNode* nodep) { setOp1p(nodep); }
|
||||
};
|
||||
|
||||
class AstMethodSel : public AstNode {
|
||||
class AstMethodCall : public AstNode {
|
||||
// A reference to a member task (or function)
|
||||
// We do not support generic member calls yet, so this is only enough to
|
||||
// make built-in methods work
|
||||
private:
|
||||
string m_name; // Name of variable
|
||||
public:
|
||||
AstMethodSel(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name, AstNode* pinsp)
|
||||
AstMethodCall(FileLine* fl, AstNode* fromp, VFlagChildDType, const string& name, AstNode* pinsp)
|
||||
: AstNode(fl), m_name(name) {
|
||||
setOp1p(fromp);
|
||||
dtypep(NULL); // V3Width will resolve
|
||||
addNOp2p(pinsp);
|
||||
}
|
||||
AstMethodSel(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp)
|
||||
AstMethodCall(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp)
|
||||
: AstNode(fl), m_name(name) {
|
||||
setOp1p(fromp);
|
||||
addNOp2p(pinsp);
|
||||
}
|
||||
ASTNODE_NODE_FUNCS(MethodSel)
|
||||
ASTNODE_NODE_FUNCS(MethodCall)
|
||||
virtual string name() const { return m_name; } // * = Var name
|
||||
virtual void name(const string& name) { m_name = name; }
|
||||
AstNode* fromp() const { return op1p(); } // op1 = Extracting what (NULL=TBD during parsing)
|
||||
|
@ -2264,7 +2264,7 @@ private:
|
||||
// EnumItemRef may be under a dot. Should already be resolved.
|
||||
iterateChildren(nodep);
|
||||
}
|
||||
virtual void visit(AstMethodSel* nodep) {
|
||||
virtual void visit(AstMethodCall* nodep) {
|
||||
// Created here so should already be resolved.
|
||||
DotStates lastStates = m_ds;
|
||||
{
|
||||
@ -2312,8 +2312,8 @@ private:
|
||||
AstNode* varEtcp = m_ds.m_dotp->lhsp()->unlinkFrBack();
|
||||
AstNode* argsp = NULL;
|
||||
if (nodep->pinsp()) argsp = nodep->pinsp()->unlinkFrBackWithNext();
|
||||
AstNode* newp = new AstMethodSel(nodep->fileline(), varEtcp,
|
||||
VFlagChildDType(), nodep->name(), argsp);
|
||||
AstNode* newp = new AstMethodCall(nodep->fileline(), varEtcp,
|
||||
VFlagChildDType(), nodep->name(), argsp);
|
||||
nodep->replaceWith(newp);
|
||||
pushDeletep(nodep); VL_DANGLING(nodep);
|
||||
return;
|
||||
|
@ -1592,8 +1592,8 @@ private:
|
||||
|| VN_IS(fromDtp, BasicDType)) {
|
||||
// Method call on enum without following parenthesis, e.g. "ENUM.next"
|
||||
// Convert this into a method call, and let that visitor figure out what to do next
|
||||
AstNode* newp = new AstMethodSel(nodep->fileline(),
|
||||
nodep->fromp()->unlinkFrBack(), nodep->name(), NULL);
|
||||
AstNode* newp = new AstMethodCall(nodep->fileline(),
|
||||
nodep->fromp()->unlinkFrBack(), nodep->name(), NULL);
|
||||
nodep->replaceWith(newp);
|
||||
pushDeletep(nodep); VL_DANGLING(nodep);
|
||||
userIterate(newp, m_vup);
|
||||
@ -1629,7 +1629,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
virtual void visit(AstMethodSel* nodep) {
|
||||
virtual void visit(AstMethodCall* nodep) {
|
||||
UINFO(5," METHODSEL "<<nodep<<endl);
|
||||
if (debug()>=9) nodep->dumpTree("-mts-in: ");
|
||||
// Should check types the method requires, but at present we don't do much
|
||||
@ -1659,7 +1659,7 @@ private:
|
||||
<<"' which is a '"<<nodep->fromp()->dtypep()->prettyTypeName()<<"'");
|
||||
}
|
||||
}
|
||||
void methodOkArguments(AstMethodSel* nodep, int minArg, int maxArg) {
|
||||
void methodOkArguments(AstMethodCall* nodep, int minArg, int maxArg) {
|
||||
int narg = 0;
|
||||
for (AstNode* argp = nodep->pinsp(); argp; argp = argp->nextp()) {
|
||||
++narg;
|
||||
@ -1684,7 +1684,7 @@ private:
|
||||
}
|
||||
}
|
||||
|
||||
void methodCallEnum(AstMethodSel* nodep, AstEnumDType* adtypep) {
|
||||
void methodCallEnum(AstMethodCall* nodep, AstEnumDType* adtypep) {
|
||||
// Method call on enum without following parenthesis, e.g. "ENUM.next"
|
||||
// Convert this into a method call, and let that visitor figure out what to do next
|
||||
if (adtypep) {}
|
||||
@ -1764,7 +1764,7 @@ private:
|
||||
nodep->v3error("Unknown built-in enum method " << nodep->prettyNameQ());
|
||||
}
|
||||
}
|
||||
void methodCallUnpack(AstMethodSel* nodep, AstUnpackArrayDType* adtypep) {
|
||||
void methodCallUnpack(AstMethodCall* nodep, AstUnpackArrayDType* adtypep) {
|
||||
enum { UNKNOWN = 0, ARRAY_OR, ARRAY_AND, ARRAY_XOR } methodId;
|
||||
|
||||
methodId = UNKNOWN;
|
||||
@ -1796,7 +1796,7 @@ private:
|
||||
nodep->v3error("Unknown built-in array method " << nodep->prettyNameQ());
|
||||
}
|
||||
}
|
||||
void methodCallString(AstMethodSel* nodep, AstBasicDType* adtypep) {
|
||||
void methodCallString(AstMethodCall* nodep, AstBasicDType* adtypep) {
|
||||
// Method call on string
|
||||
if (nodep->name() == "len") {
|
||||
// Constant value
|
||||
@ -3886,7 +3886,7 @@ private:
|
||||
//----------------------------------------------------------------------
|
||||
// METHODS - strings
|
||||
|
||||
void replaceWithSFormat(AstMethodSel* nodep, const string& format) {
|
||||
void replaceWithSFormat(AstMethodCall* nodep, const string& format) {
|
||||
// For string.itoa and similar, replace with SFormatF
|
||||
AstArg* argp = VN_CAST(nodep->pinsp(), Arg);
|
||||
if (!argp) {
|
||||
|
Loading…
Reference in New Issue
Block a user