improve formating

This commit is contained in:
Christoph Kubisch 2019-04-16 10:00:28 +02:00
parent 8a0e12a107
commit 4b1dfc56b1

View File

@ -179,49 +179,46 @@ void TType::buildMangledName(TString& mangledName) const
void TSymbol::dumpExtensions(TInfoSink &infoSink) const void TSymbol::dumpExtensions(TInfoSink &infoSink) const
{ {
int numExtensions = getNumExtensions(); int numExtensions = getNumExtensions();
if (numExtensions) if (numExtensions) {
{
infoSink.debug << " <"; infoSink.debug << " <";
for (int i = 0; i < numExtensions; i++) for (int i = 0; i < numExtensions; i++)
{
infoSink.debug << getExtensions()[i] << ","; infoSink.debug << getExtensions()[i] << ",";
}
infoSink.debug << ">"; infoSink.debug << ">";
} }
} }
void TVariable::dump(TInfoSink &infoSink, bool complete) const void TVariable::dump(TInfoSink &infoSink, bool complete) const
{ {
if (complete) if (complete) {
{
infoSink.debug << getName().c_str() << ": " << type.getCompleteString(); infoSink.debug << getName().c_str() << ": " << type.getCompleteString();
dumpExtensions(infoSink); dumpExtensions(infoSink);
} else } else
{ {
infoSink.debug << getName().c_str() << ": " << type.getStorageQualifierString() << " " infoSink.debug << getName().c_str() << ": " << type.getStorageQualifierString() << " "
<< type.getBasicTypeString(); << type.getBasicTypeString();
if (type.isArray()) if (type.isArray())
{
infoSink.debug << "[0]"; infoSink.debug << "[0]";
} }
}
infoSink.debug << "\n"; infoSink.debug << "\n";
} }
void TFunction::dump(TInfoSink &infoSink, bool complete) const void TFunction::dump(TInfoSink &infoSink, bool complete) const
{ {
if (complete) if (complete) {
{
infoSink.debug << getName().c_str() << ": " << returnType.getCompleteString() << " " << getName().c_str() infoSink.debug << getName().c_str() << ": " << returnType.getCompleteString() << " " << getName().c_str()
<< "("; << "(";
int numParams = getParamCount(); int numParams = getParamCount();
for (int i = 0; i < numParams; i++) for (int i = 0; i < numParams; i++) {
{
const TParameter &param = parameters[i]; const TParameter &param = parameters[i];
infoSink.debug << param.type->getCompleteString() << " " infoSink.debug << param.type->getCompleteString() << " "
<< (param.name ? param.name->c_str() : "") << (i < numParams - 1 ? "," : ""); << (param.name ? param.name->c_str() : "") << (i < numParams - 1 ? "," : "");
} }
infoSink.debug << ")"; infoSink.debug << ")";
dumpExtensions(infoSink); dumpExtensions(infoSink);
} else } else