1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-10 12:32:20 +02:00

Boxed struct ptr changes.

This commit is contained in:
Brian Fiete 2019-10-09 16:16:01 -07:00
parent ad2542eba6
commit 5af6428bf4
20 changed files with 573 additions and 327 deletions

View file

@ -1357,13 +1357,12 @@ void BeIRCodeGen::HandleNextCmd()
{
CMD_PARAM(BeValue*, val);
CMD_PARAM(int, idx);
BF_ASSERT(val->GetType()->IsComposite());
auto extractValueInst = mBeModule->AllocInst<BeExtractValueInst>();
extractValueInst->mAggVal = val;
extractValueInst->mIdx = idx;
BF_ASSERT(val->GetType()->IsComposite());
extractValueInst->mIdx = idx;
SetResult(curId, extractValueInst);
}
break;

View file

@ -2394,6 +2394,20 @@ void BeModule::Print(BeFunction* func)
OutputDebugStr(ToString(func));
}
void BeModule::PrintValue(BeValue* val)
{
BeDumpContext dumpCtx;
dumpCtx.mModule = this;
String str;
dumpCtx.ToString(str, val);
str += "\n";
OutputDebugStr(str);
auto type = val->GetType();
if (type != NULL)
bpt(type);
}
void BeModule::DoInlining(BeFunction* func)
{
//bool debugging = func->mName == "?Test@Program@bf@@CAXXZ";
@ -3138,9 +3152,9 @@ BeGEPInst* BeModule::CreateGEP(BeValue* ptr, BeValue* idx0, BeValue* idx1)
inst->mIdx0 = idx0;
inst->mIdx1 = idx1;
AddInst(inst);
BF_ASSERT(ptr->GetType()->IsPointer());
#ifdef _DEBUG
BF_ASSERT(ptr->GetType()->IsPointer());
inst->GetType();
#endif

View file

@ -2109,6 +2109,7 @@ public:
String ToString(BeFunction* func = NULL);
void Print();
void Print(BeFunction* func);
void PrintValue(BeValue* val);
void DoInlining(BeFunction* func);
void DoInlining();