GP-1642 Display formats for data-types

This commit is contained in:
caheckman 2022-01-05 19:32:44 -05:00
parent 9c04807c8c
commit 955838cd62
12 changed files with 266 additions and 99 deletions

View file

@ -3191,7 +3191,12 @@ void parse_C(Architecture *glb,istream &s)
Datatype *ct = decl->buildType(glb);
if (decl->getIdentifier().size() == 0)
throw ParseError("Missing identifier for typedef");
glb->types->setName(ct,decl->getIdentifier());
if (ct->getMetatype() == TYPE_STRUCT) {
glb->types->setName(ct,decl->getIdentifier());
}
else {
glb->types->getTypedef(ct,decl->getIdentifier(),0,0);
}
}
else if (decl->getBaseType()->getMetatype()==TYPE_STRUCT) {
// We parsed a struct, treat as a typedef