mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-10 04:22:20 +02:00
Better ToString support for values
This commit is contained in:
parent
cbacf99a61
commit
014ce28195
5 changed files with 43 additions and 34 deletions
|
@ -1197,9 +1197,16 @@ String BfIRBuilder::ToString(BfIRValue irValue)
|
|||
{
|
||||
auto val = mBeIRCodeGen->GetBeValue(irValue.mId);
|
||||
String str;
|
||||
BeDumpContext dc;
|
||||
dc.mModule = mBeIRCodeGen->mBeModule;
|
||||
BeDumpContext dc;
|
||||
dc.ToString(str, val);
|
||||
|
||||
auto type = val->GetType();
|
||||
if (type != NULL)
|
||||
{
|
||||
str += "\n";
|
||||
dc.ToString(str, type);
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
#endif
|
||||
|
@ -1267,8 +1274,7 @@ String BfIRBuilder::ToString(BfIRType irType)
|
|||
}
|
||||
|
||||
String str;
|
||||
BeDumpContext dc;
|
||||
dc.mModule = mBeIRCodeGen->mBeModule;
|
||||
BeDumpContext dc;
|
||||
dc.ToString(str, beType);
|
||||
return str;
|
||||
}
|
||||
|
@ -1302,8 +1308,7 @@ String BfIRBuilder::ToString(BfIRFunction irFunc)
|
|||
return "null";
|
||||
|
||||
String str;
|
||||
BeDumpContext dc;
|
||||
dc.mModule = mBeIRCodeGen->mBeModule;
|
||||
BeDumpContext dc;
|
||||
dc.ToString(str, val);
|
||||
return str;
|
||||
}
|
||||
|
@ -1349,8 +1354,7 @@ String BfIRBuilder::ToString(BfIRMDNode irMDNode)
|
|||
if (md == NULL)
|
||||
return "null";
|
||||
String str;
|
||||
BeDumpContext dc;
|
||||
dc.mModule = mBeIRCodeGen->mBeModule;
|
||||
BeDumpContext dc;
|
||||
dc.ToString(str, md);
|
||||
return str;
|
||||
}
|
||||
|
@ -5060,3 +5064,4 @@ void BfIRBuilder::DbgCreateAnnotation(BfIRMDNode scope, const StringImpl& name,
|
|||
NEW_CMD_INSERTED;
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue