Internals: Spacing fixes. No functional change.
This commit is contained in:
parent
d9b33d74a4
commit
0094cd7a81
|
|
@ -561,15 +561,16 @@ int AstNodeDType::widthPow2() const {
|
||||||
AstNode* AstArraySel::baseFromp(AstNode* nodep) { ///< What is the base variable (or const) this dereferences?
|
AstNode* AstArraySel::baseFromp(AstNode* nodep) { ///< What is the base variable (or const) this dereferences?
|
||||||
// Else AstArraySel etc; search for the base
|
// Else AstArraySel etc; search for the base
|
||||||
while (nodep) {
|
while (nodep) {
|
||||||
if (VN_IS(nodep, ArraySel)) { nodep=VN_CAST(nodep, ArraySel)->fromp(); continue; }
|
if (VN_IS(nodep, ArraySel)) { nodep = VN_CAST(nodep, ArraySel)->fromp(); continue; }
|
||||||
else if (VN_IS(nodep, Sel)) { nodep=VN_CAST(nodep, Sel)->fromp(); continue; }
|
else if (VN_IS(nodep, Sel)) { nodep = VN_CAST(nodep, Sel)->fromp(); continue; }
|
||||||
// AstNodeSelPre stashes the associated variable under an ATTROF of AstAttrType::VAR_BASE/MEMBER_BASE so it isn't constified
|
// AstNodeSelPre stashes the associated variable under an ATTROF
|
||||||
else if (VN_IS(nodep, AttrOf)) { nodep=VN_CAST(nodep, AttrOf)->fromp(); continue; }
|
// of AstAttrType::VAR_BASE/MEMBER_BASE so it isn't constified
|
||||||
|
else if (VN_IS(nodep, AttrOf)) { nodep = VN_CAST(nodep, AttrOf)->fromp(); continue; }
|
||||||
else if (VN_IS(nodep, NodePreSel)) {
|
else if (VN_IS(nodep, NodePreSel)) {
|
||||||
if (VN_CAST(nodep, NodePreSel)->attrp()) {
|
if (VN_CAST(nodep, NodePreSel)->attrp()) {
|
||||||
nodep=VN_CAST(nodep, NodePreSel)->attrp();
|
nodep = VN_CAST(nodep, NodePreSel)->attrp();
|
||||||
} else {
|
} else {
|
||||||
nodep=VN_CAST(nodep, NodePreSel)->lhsp();
|
nodep = VN_CAST(nodep, NodePreSel)->lhsp();
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -927,7 +927,7 @@ class AstSelPlus : public AstNodePreSel {
|
||||||
// Gets replaced during link with AstSel
|
// Gets replaced during link with AstSel
|
||||||
public:
|
public:
|
||||||
AstSelPlus(FileLine* fl, AstNode* fromp, AstNode* bitp, AstNode* widthp)
|
AstSelPlus(FileLine* fl, AstNode* fromp, AstNode* bitp, AstNode* widthp)
|
||||||
:AstNodePreSel(fl, fromp, bitp, widthp) {}
|
: AstNodePreSel(fl, fromp, bitp, widthp) {}
|
||||||
ASTNODE_NODE_FUNCS(SelPlus)
|
ASTNODE_NODE_FUNCS(SelPlus)
|
||||||
AstNode* bitp() const { return rhsp(); }
|
AstNode* bitp() const { return rhsp(); }
|
||||||
AstNode* widthp() const { return thsp(); }
|
AstNode* widthp() const { return thsp(); }
|
||||||
|
|
@ -938,7 +938,7 @@ class AstSelMinus : public AstNodePreSel {
|
||||||
// Gets replaced during link with AstSel
|
// Gets replaced during link with AstSel
|
||||||
public:
|
public:
|
||||||
AstSelMinus(FileLine* fl, AstNode* fromp, AstNode* bitp, AstNode* widthp)
|
AstSelMinus(FileLine* fl, AstNode* fromp, AstNode* bitp, AstNode* widthp)
|
||||||
:AstNodePreSel(fl, fromp, bitp, widthp) {}
|
: AstNodePreSel(fl, fromp, bitp, widthp) {}
|
||||||
ASTNODE_NODE_FUNCS(SelMinus)
|
ASTNODE_NODE_FUNCS(SelMinus)
|
||||||
AstNode* bitp() const { return rhsp(); }
|
AstNode* bitp() const { return rhsp(); }
|
||||||
AstNode* widthp() const { return thsp(); }
|
AstNode* widthp() const { return thsp(); }
|
||||||
|
|
@ -955,7 +955,7 @@ private:
|
||||||
int m_declElWidth; // If a packed array, the number of bits per element
|
int m_declElWidth; // If a packed array, the number of bits per element
|
||||||
public:
|
public:
|
||||||
AstSel(FileLine* fl, AstNode* fromp, AstNode* lsbp, AstNode* widthp)
|
AstSel(FileLine* fl, AstNode* fromp, AstNode* lsbp, AstNode* widthp)
|
||||||
:AstNodeTriop(fl, fromp, lsbp, widthp) {
|
: AstNodeTriop(fl, fromp, lsbp, widthp) {
|
||||||
m_declElWidth = 1;
|
m_declElWidth = 1;
|
||||||
if (VN_IS(widthp, Const)) {
|
if (VN_IS(widthp, Const)) {
|
||||||
dtypeSetLogicSized(VN_CAST(widthp, Const)->toUInt(),
|
dtypeSetLogicSized(VN_CAST(widthp, Const)->toUInt(),
|
||||||
|
|
@ -964,7 +964,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
AstSel(FileLine* fl, AstNode* fromp, int lsb, int bitwidth)
|
AstSel(FileLine* fl, AstNode* fromp, int lsb, int bitwidth)
|
||||||
:AstNodeTriop(fl, fromp,
|
: AstNodeTriop(fl, fromp,
|
||||||
new AstConst(fl,lsb), new AstConst(fl,bitwidth)) {
|
new AstConst(fl,lsb), new AstConst(fl,bitwidth)) {
|
||||||
m_declElWidth = 1;
|
m_declElWidth = 1;
|
||||||
dtypeSetLogicSized(bitwidth,bitwidth,AstNumeric::UNSIGNED);
|
dtypeSetLogicSized(bitwidth,bitwidth,AstNumeric::UNSIGNED);
|
||||||
|
|
@ -1076,7 +1076,7 @@ public:
|
||||||
addNOp2p(pinsp);
|
addNOp2p(pinsp);
|
||||||
}
|
}
|
||||||
AstMethodSel(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp)
|
AstMethodSel(FileLine* fl, AstNode* fromp, const string& name, AstNode* pinsp)
|
||||||
:AstNode(fl), m_name(name) {
|
: AstNode(fl), m_name(name) {
|
||||||
setOp1p(fromp);
|
setOp1p(fromp);
|
||||||
addNOp2p(pinsp);
|
addNOp2p(pinsp);
|
||||||
}
|
}
|
||||||
|
|
@ -1144,7 +1144,7 @@ private:
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstNodeDType* dtp)
|
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagChildDType, AstNodeDType* dtp)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_name(name), m_origName(name) {
|
, m_name(name), m_origName(name) {
|
||||||
init();
|
init();
|
||||||
combineType(type);
|
combineType(type);
|
||||||
|
|
@ -1154,7 +1154,7 @@ public:
|
||||||
else m_declKwd = AstBasicDTypeKwd::LOGIC;
|
else m_declKwd = AstBasicDTypeKwd::LOGIC;
|
||||||
}
|
}
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name, AstNodeDType* dtp)
|
AstVar(FileLine* fl, AstVarType type, const string& name, AstNodeDType* dtp)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_name(name), m_origName(name) {
|
, m_name(name), m_origName(name) {
|
||||||
init();
|
init();
|
||||||
combineType(type);
|
combineType(type);
|
||||||
|
|
@ -1164,7 +1164,7 @@ public:
|
||||||
else m_declKwd = AstBasicDTypeKwd::LOGIC;
|
else m_declKwd = AstBasicDTypeKwd::LOGIC;
|
||||||
}
|
}
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagLogicPacked, int wantwidth)
|
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagLogicPacked, int wantwidth)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_name(name), m_origName(name) {
|
, m_name(name), m_origName(name) {
|
||||||
init();
|
init();
|
||||||
combineType(type);
|
combineType(type);
|
||||||
|
|
@ -1172,7 +1172,7 @@ public:
|
||||||
m_declKwd = AstBasicDTypeKwd::LOGIC;
|
m_declKwd = AstBasicDTypeKwd::LOGIC;
|
||||||
}
|
}
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagBitPacked, int wantwidth)
|
AstVar(FileLine* fl, AstVarType type, const string& name, VFlagBitPacked, int wantwidth)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_name(name), m_origName(name) {
|
, m_name(name), m_origName(name) {
|
||||||
init();
|
init();
|
||||||
combineType(type);
|
combineType(type);
|
||||||
|
|
@ -1180,7 +1180,7 @@ public:
|
||||||
m_declKwd = AstBasicDTypeKwd::BIT;
|
m_declKwd = AstBasicDTypeKwd::BIT;
|
||||||
}
|
}
|
||||||
AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep)
|
AstVar(FileLine* fl, AstVarType type, const string& name, AstVar* examplep)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_name(name), m_origName(name) {
|
, m_name(name), m_origName(name) {
|
||||||
init();
|
init();
|
||||||
combineType(type);
|
combineType(type);
|
||||||
|
|
@ -1397,7 +1397,7 @@ private:
|
||||||
public:
|
public:
|
||||||
AstScope(FileLine* fl, AstNodeModule* modp, const string& name,
|
AstScope(FileLine* fl, AstNodeModule* modp, const string& name,
|
||||||
AstScope* aboveScopep, AstCell* aboveCellp)
|
AstScope* aboveScopep, AstCell* aboveCellp)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
,m_name(name) ,m_aboveScopep(aboveScopep) ,m_aboveCellp(aboveCellp), m_modp(modp) {}
|
,m_name(name) ,m_aboveScopep(aboveScopep) ,m_aboveCellp(aboveCellp), m_modp(modp) {}
|
||||||
ASTNODE_NODE_FUNCS(Scope)
|
ASTNODE_NODE_FUNCS(Scope)
|
||||||
virtual void cloneRelink();
|
virtual void cloneRelink();
|
||||||
|
|
@ -1426,7 +1426,7 @@ class AstTopScope : public AstNode {
|
||||||
// Children: SCOPEs
|
// Children: SCOPEs
|
||||||
public:
|
public:
|
||||||
AstTopScope(FileLine* fl, AstScope* ascopep)
|
AstTopScope(FileLine* fl, AstScope* ascopep)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
{addNOp2p(ascopep);}
|
{addNOp2p(ascopep);}
|
||||||
ASTNODE_NODE_FUNCS(TopScope)
|
ASTNODE_NODE_FUNCS(TopScope)
|
||||||
AstNode* stmtsp() const { return op1p(); }
|
AstNode* stmtsp() const { return op1p(); }
|
||||||
|
|
@ -1446,7 +1446,7 @@ private:
|
||||||
bool m_trace:1; // Tracing is turned on for this scope
|
bool m_trace:1; // Tracing is turned on for this scope
|
||||||
public:
|
public:
|
||||||
AstVarScope(FileLine* fl, AstScope* scopep, AstVar* varp)
|
AstVarScope(FileLine* fl, AstScope* scopep, AstVar* varp)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
, m_scopep(scopep), m_varp(varp) {
|
, m_scopep(scopep), m_varp(varp) {
|
||||||
m_circular = false;
|
m_circular = false;
|
||||||
m_trace = true;
|
m_trace = true;
|
||||||
|
|
@ -1517,10 +1517,10 @@ private:
|
||||||
string m_inlinedDots; // Dotted hierarchy flattened out
|
string m_inlinedDots; // Dotted hierarchy flattened out
|
||||||
public:
|
public:
|
||||||
AstVarXRef(FileLine* fl, const string& name, const string& dotted, bool lvalue)
|
AstVarXRef(FileLine* fl, const string& name, const string& dotted, bool lvalue)
|
||||||
:AstNodeVarRef(fl, name, NULL, lvalue)
|
: AstNodeVarRef(fl, name, NULL, lvalue)
|
||||||
, m_dotted(dotted) { }
|
, m_dotted(dotted) { }
|
||||||
AstVarXRef(FileLine* fl, AstVar* varp, const string& dotted, bool lvalue)
|
AstVarXRef(FileLine* fl, AstVar* varp, const string& dotted, bool lvalue)
|
||||||
:AstNodeVarRef(fl, varp->name(), varp, lvalue)
|
: AstNodeVarRef(fl, varp->name(), varp, lvalue)
|
||||||
, m_dotted(dotted) {
|
, m_dotted(dotted) {
|
||||||
dtypeFrom(varp);
|
dtypeFrom(varp);
|
||||||
}
|
}
|
||||||
|
|
@ -1555,7 +1555,7 @@ private:
|
||||||
bool m_svImplicit; // Pin is SystemVerilog .name'ed
|
bool m_svImplicit; // Pin is SystemVerilog .name'ed
|
||||||
public:
|
public:
|
||||||
AstPin(FileLine* fl, int pinNum, const string& name, AstNode* exprp)
|
AstPin(FileLine* fl, int pinNum, const string& name, AstNode* exprp)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
,m_name(name), m_param(false), m_svImplicit(false) {
|
,m_name(name), m_param(false), m_svImplicit(false) {
|
||||||
m_pinNum = pinNum;
|
m_pinNum = pinNum;
|
||||||
m_modVarp = NULL;
|
m_modVarp = NULL;
|
||||||
|
|
@ -1563,7 +1563,7 @@ public:
|
||||||
setNOp1p(exprp);
|
setNOp1p(exprp);
|
||||||
}
|
}
|
||||||
AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp)
|
AstPin(FileLine* fl, int pinNum, AstVarRef* varname, AstNode* exprp)
|
||||||
:AstNode(fl), m_param(false), m_svImplicit(false) {
|
: AstNode(fl), m_param(false), m_svImplicit(false) {
|
||||||
m_name = varname->name();
|
m_name = varname->name();
|
||||||
m_pinNum = pinNum;
|
m_pinNum = pinNum;
|
||||||
m_modVarp = NULL;
|
m_modVarp = NULL;
|
||||||
|
|
@ -1903,7 +1903,7 @@ private:
|
||||||
string m_name; // Name of pin
|
string m_name; // Name of pin
|
||||||
public:
|
public:
|
||||||
AstPort(FileLine* fl, int pinnum, const string& name)
|
AstPort(FileLine* fl, int pinnum, const string& name)
|
||||||
:AstNode(fl)
|
: AstNode(fl)
|
||||||
,m_pinNum(pinnum) ,m_name(name) {}
|
,m_pinNum(pinnum) ,m_name(name) {}
|
||||||
ASTNODE_NODE_FUNCS(Port)
|
ASTNODE_NODE_FUNCS(Port)
|
||||||
virtual string name() const { return m_name; } // * = Port name
|
virtual string name() const { return m_name; } // * = Port name
|
||||||
|
|
@ -1939,7 +1939,7 @@ private:
|
||||||
string m_name;
|
string m_name;
|
||||||
public:
|
public:
|
||||||
AstParseRef(FileLine* fl, AstParseRefExp expect, const string& name, AstNode* lhsp, AstNodeFTaskRef* ftaskrefp)
|
AstParseRef(FileLine* fl, AstParseRefExp expect, const string& name, AstNode* lhsp, AstNodeFTaskRef* ftaskrefp)
|
||||||
:AstNode(fl), m_expect(expect), m_name(name) { setNOp1p(lhsp); setNOp2p(ftaskrefp); }
|
: AstNode(fl), m_expect(expect), m_name(name) { setNOp1p(lhsp); setNOp2p(ftaskrefp); }
|
||||||
ASTNODE_NODE_FUNCS(ParseRef)
|
ASTNODE_NODE_FUNCS(ParseRef)
|
||||||
virtual void dump(std::ostream& str);
|
virtual void dump(std::ostream& str);
|
||||||
virtual string name() const { return m_name; } // * = Var name
|
virtual string name() const { return m_name; } // * = Var name
|
||||||
|
|
@ -1984,7 +1984,7 @@ class AstDot : public AstNode {
|
||||||
// These are eliminated in the link stage
|
// These are eliminated in the link stage
|
||||||
public:
|
public:
|
||||||
AstDot(FileLine* fl, AstNode* lhsp, AstNode* rhsp)
|
AstDot(FileLine* fl, AstNode* lhsp, AstNode* rhsp)
|
||||||
:AstNode(fl) { setOp1p(lhsp); setOp2p(rhsp); }
|
: AstNode(fl) { setOp1p(lhsp); setOp2p(rhsp); }
|
||||||
ASTNODE_NODE_FUNCS(Dot)
|
ASTNODE_NODE_FUNCS(Dot)
|
||||||
static AstNode* newIfPkg(FileLine*fl, AstPackage* packagep, AstNode* rhsp) { // For parser, make only if non-null package
|
static AstNode* newIfPkg(FileLine*fl, AstPackage* packagep, AstNode* rhsp) { // For parser, make only if non-null package
|
||||||
if (!packagep) return rhsp;
|
if (!packagep) return rhsp;
|
||||||
|
|
@ -2003,7 +2003,7 @@ class AstTask : public AstNodeFTask {
|
||||||
// A task inside a module
|
// A task inside a module
|
||||||
public:
|
public:
|
||||||
AstTask(FileLine* fl, const string& name, AstNode* stmtp)
|
AstTask(FileLine* fl, const string& name, AstNode* stmtp)
|
||||||
:AstNodeFTask(fl, name, stmtp) {}
|
: AstNodeFTask(fl, name, stmtp) {}
|
||||||
ASTNODE_NODE_FUNCS(Task)
|
ASTNODE_NODE_FUNCS(Task)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -2011,7 +2011,7 @@ class AstFunc : public AstNodeFTask {
|
||||||
// A function inside a module
|
// A function inside a module
|
||||||
public:
|
public:
|
||||||
AstFunc(FileLine* fl, const string& name, AstNode* stmtp, AstNode* fvarsp)
|
AstFunc(FileLine* fl, const string& name, AstNode* stmtp, AstNode* fvarsp)
|
||||||
:AstNodeFTask(fl, name, stmtp) {
|
: AstNodeFTask(fl, name, stmtp) {
|
||||||
addNOp1p(fvarsp);
|
addNOp1p(fvarsp);
|
||||||
}
|
}
|
||||||
ASTNODE_NODE_FUNCS(Func)
|
ASTNODE_NODE_FUNCS(Func)
|
||||||
|
|
@ -2022,9 +2022,9 @@ class AstTaskRef : public AstNodeFTaskRef {
|
||||||
// A reference to a task
|
// A reference to a task
|
||||||
public:
|
public:
|
||||||
AstTaskRef(FileLine* fl, AstParseRef* namep, AstNode* pinsp)
|
AstTaskRef(FileLine* fl, AstParseRef* namep, AstNode* pinsp)
|
||||||
:AstNodeFTaskRef(fl, namep, pinsp) {}
|
: AstNodeFTaskRef(fl, namep, pinsp) {}
|
||||||
AstTaskRef(FileLine* fl, const string& name, AstNode* pinsp)
|
AstTaskRef(FileLine* fl, const string& name, AstNode* pinsp)
|
||||||
:AstNodeFTaskRef(fl, name, pinsp) {}
|
: AstNodeFTaskRef(fl, name, pinsp) {}
|
||||||
ASTNODE_NODE_FUNCS(TaskRef)
|
ASTNODE_NODE_FUNCS(TaskRef)
|
||||||
virtual bool isStatement() const { return true; } // A statement, unlike FuncRef
|
virtual bool isStatement() const { return true; } // A statement, unlike FuncRef
|
||||||
};
|
};
|
||||||
|
|
@ -2033,9 +2033,9 @@ class AstFuncRef : public AstNodeFTaskRef {
|
||||||
// A reference to a function
|
// A reference to a function
|
||||||
public:
|
public:
|
||||||
AstFuncRef(FileLine* fl, AstParseRef* namep, AstNode* pinsp)
|
AstFuncRef(FileLine* fl, AstParseRef* namep, AstNode* pinsp)
|
||||||
:AstNodeFTaskRef(fl, namep, pinsp) {}
|
: AstNodeFTaskRef(fl, namep, pinsp) {}
|
||||||
AstFuncRef(FileLine* fl, const string& name, AstNode* pinsp)
|
AstFuncRef(FileLine* fl, const string& name, AstNode* pinsp)
|
||||||
:AstNodeFTaskRef(fl, name, pinsp) {}
|
: AstNodeFTaskRef(fl, name, pinsp) {}
|
||||||
ASTNODE_NODE_FUNCS(FuncRef)
|
ASTNODE_NODE_FUNCS(FuncRef)
|
||||||
virtual bool isStatement() const { return false; } // Not a statement, unlike TaskRef
|
virtual bool isStatement() const { return false; } // Not a statement, unlike TaskRef
|
||||||
virtual bool hasDType() const { return true; }
|
virtual bool hasDType() const { return true; }
|
||||||
|
|
@ -2050,7 +2050,7 @@ private:
|
||||||
string m_cname; // Name of function on c side
|
string m_cname; // Name of function on c side
|
||||||
public:
|
public:
|
||||||
AstDpiExport(FileLine* fl, const string& vname, const string& cname)
|
AstDpiExport(FileLine* fl, const string& vname, const string& cname)
|
||||||
:AstNode(fl), m_name(vname), m_cname(cname) { }
|
: AstNode(fl), m_name(vname), m_cname(cname) { }
|
||||||
ASTNODE_NODE_FUNCS(DpiExport)
|
ASTNODE_NODE_FUNCS(DpiExport)
|
||||||
virtual string name() const { return m_name; }
|
virtual string name() const { return m_name; }
|
||||||
virtual void name(const string& name) { m_name = name; }
|
virtual void name(const string& name) { m_name = name; }
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue