forked from github/verilator
Internals: Rename AstRefDType subDTypep. Merge from dtype. No functional change.
This commit is contained in:
parent
486b6580d8
commit
91e4010039
@ -366,21 +366,21 @@ public:
|
|||||||
|
|
||||||
struct AstRefDType : public AstNodeDType {
|
struct AstRefDType : public AstNodeDType {
|
||||||
private:
|
private:
|
||||||
AstNodeDType* m_subDTypep; // data type pointed to, BELOW the AstTypedef
|
AstNodeDType* m_refDTypep; // data type pointed to, BELOW the AstTypedef
|
||||||
string m_name; // Name of an AstTypedef
|
string m_name; // Name of an AstTypedef
|
||||||
AstPackage* m_packagep; // Package hierarchy
|
AstPackage* m_packagep; // Package hierarchy
|
||||||
public:
|
public:
|
||||||
AstRefDType(FileLine* fl, const string& name)
|
AstRefDType(FileLine* fl, const string& name)
|
||||||
: AstNodeDType(fl), m_subDTypep(NULL), m_name(name), m_packagep(NULL) {}
|
: AstNodeDType(fl), m_refDTypep(NULL), m_name(name), m_packagep(NULL) {}
|
||||||
AstRefDType(FileLine* fl, AstNodeDType* defp)
|
AstRefDType(FileLine* fl, AstNodeDType* defp)
|
||||||
: AstNodeDType(fl), m_subDTypep(defp), m_packagep(NULL) {
|
: AstNodeDType(fl), m_refDTypep(defp), m_packagep(NULL) {
|
||||||
widthSignedFrom(defp);
|
widthSignedFrom(defp);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(RefDType, REFDTYPE)
|
ASTNODE_NODE_FUNCS(RefDType, REFDTYPE)
|
||||||
// METHODS
|
// METHODS
|
||||||
virtual bool broken() const { return m_subDTypep && !m_subDTypep->brokeExists(); }
|
virtual bool broken() const { return m_refDTypep && !m_refDTypep->brokeExists(); }
|
||||||
virtual void cloneRelink() { if (m_subDTypep && m_subDTypep->clonep()) {
|
virtual void cloneRelink() { if (m_refDTypep && m_refDTypep->clonep()) {
|
||||||
m_subDTypep = m_subDTypep->clonep()->castNodeDType();
|
m_refDTypep = m_refDTypep->clonep()->castNodeDType();
|
||||||
}}
|
}}
|
||||||
virtual bool same(AstNode* samep) const {
|
virtual bool same(AstNode* samep) const {
|
||||||
return skipRefp()->sameTree(samep->castRefDType()->skipRefp()); }
|
return skipRefp()->sameTree(samep->castRefDType()->skipRefp()); }
|
||||||
@ -401,9 +401,10 @@ public:
|
|||||||
else { v3fatalSrc("Typedef not linked"); return NULL; }
|
else { v3fatalSrc("Typedef not linked"); return NULL; }
|
||||||
}
|
}
|
||||||
AstNodeDType* dtypeSkipRefp() const { return defp()->skipRefp(); } // op1 = Range of variable
|
AstNodeDType* dtypeSkipRefp() const { return defp()->skipRefp(); } // op1 = Range of variable
|
||||||
AstNodeDType* defp() const { return m_subDTypep; }
|
AstNodeDType* defp() const { return m_refDTypep; } // Code backward compatibility name for refDTypep
|
||||||
AstNodeDType* subDTypep() const { return m_subDTypep; }
|
AstNodeDType* refDTypep() const { return m_refDTypep; }
|
||||||
void subDTypep(AstNodeDType* nodep) { m_subDTypep=nodep; }
|
void refDTypep(AstNodeDType* nodep) { m_refDTypep=nodep; }
|
||||||
|
AstNodeDType* subDTypep() const { return m_refDTypep; }
|
||||||
AstPackage* packagep() const { return m_packagep; }
|
AstPackage* packagep() const { return m_packagep; }
|
||||||
void packagep(AstPackage* nodep) { m_packagep=nodep; }
|
void packagep(AstPackage* nodep) { m_packagep=nodep; }
|
||||||
};
|
};
|
||||||
|
@ -551,7 +551,7 @@ private:
|
|||||||
defp = m_curVarsp->findIdUpward(nodep->name())->castTypedef();
|
defp = m_curVarsp->findIdUpward(nodep->name())->castTypedef();
|
||||||
}
|
}
|
||||||
if (!defp) { nodep->v3error("Can't find typedef: "<<nodep->prettyName()); }
|
if (!defp) { nodep->v3error("Can't find typedef: "<<nodep->prettyName()); }
|
||||||
nodep->subDTypep(defp->subDTypep());
|
nodep->refDTypep(defp->subDTypep());
|
||||||
nodep->packagep(packageFor(defp));
|
nodep->packagep(packageFor(defp));
|
||||||
}
|
}
|
||||||
nodep->iterateChildren(*this);
|
nodep->iterateChildren(*this);
|
||||||
|
Loading…
Reference in New Issue
Block a user