Internals:Cleanup dpiTypesToStringConverter. No functional change is intended. (#2698)

This commit is contained in:
Yutetsu TAKATSUKASA 2020-12-13 16:05:06 +09:00 committed by GitHub
parent 457d1a66f2
commit 13e88106da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -463,21 +463,22 @@ public:
}
virtual string primitive(const AstVar* varp) const {
string type;
if (varp->basicp()->keyword().isDpiUnsignable() && !varp->basicp()->isSigned()) {
type = "unsigned ";
}
type += varp->basicp()->keyword().dpiType();
const AstBasicDTypeKwd keyword = varp->basicp()->keyword();
if (keyword.isDpiUnsignable() && !varp->basicp()->isSigned()) type = "unsigned ";
type += keyword.dpiType();
return type;
}
string convert(const AstVar* varp) const {
if (varp->isDpiOpenArray()) {
return openArray(varp);
} else if (!varp->basicp()) {
return "UNKNOWN";
} else if (varp->basicp()->isDpiBitVec() || varp->basicp()->isDpiLogicVec()) {
return bitLogicVector(varp, varp->basicp()->isDpiBitVec());
} else if (const AstBasicDType* basicp = varp->basicp()) {
if (basicp->isDpiBitVec() || basicp->isDpiLogicVec()) {
return bitLogicVector(varp, basicp->isDpiBitVec());
} else {
return primitive(varp);
}
} else {
return primitive(varp);
return "UNKNOWN";
}
}
};