mirror of
https://github.com/verilator/verilator.git
synced 2026-10-06 18:13:50 +02:00
Internals: Construct V3Number with correct type instead of changing it manually. (#3529)
This commit is contained in:
@@ -110,6 +110,18 @@ V3Number::V3Number(VerilogStringLiteral, AstNode* nodep, const string& str) {
|
||||
opCleanThis(true);
|
||||
}
|
||||
|
||||
V3Number::V3Number(AstNode* nodep, const AstNodeDType* nodedtypep) {
|
||||
if (nodedtypep->isString()) {
|
||||
init(nodep, 0);
|
||||
setString("");
|
||||
} else if (nodedtypep->isDouble()) {
|
||||
init(nodep, 64);
|
||||
setDouble(0.0);
|
||||
} else {
|
||||
init(nodep, nodedtypep->width(), nodedtypep->widthSized());
|
||||
}
|
||||
}
|
||||
|
||||
void V3Number::V3NumberCreate(AstNode* nodep, const char* sourcep, FileLine* fl) {
|
||||
init(nodep, 0);
|
||||
m_fileline = fl;
|
||||
|
||||
Reference in New Issue
Block a user