Improve printing of array constants

This commit is contained in:
baldurk
2016-02-07 18:45:26 +01:00
parent fe449eca25
commit 3dcb0411b2
@@ -453,14 +453,26 @@ struct SPVConstant
}
string ret = type->GetName();
if(type->type == SPVTypeData::eArray)
{
ret = type->baseType->GetName();
ret += StringFormat::Fmt("[%u]", (uint32_t)children.size());
}
ret += "(";
if(children.empty())
ret += GetValString();
for(size_t i=0; i < children.size(); i++)
{
ret += children[i]->GetValString();
ret += children[i]->GetIDName();
if(i+1 < children.size())
{
ret += ", ";
// put each array element on a different line, with some kind of
// estimated indent (too complex with current blindly-append
// scheme to match exactly)
if(type->type == SPVTypeData::eArray)
ret += "\n ";
}
}
ret += ")";