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:
parent
ad2542eba6
commit
5af6428bf4
20 changed files with 573 additions and 327 deletions
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue