| 404 | } |
| 405 | |
| 406 | void BeIRCodeGen::FixValues(BeStructType* structType, CmdParamVec<BeValue*>& values) |
| 407 | { |
| 408 | if (values.size() >= structType->mMembers.size()) |
| 409 | return; |
| 410 | |
| 411 | int readIdx = values.size() - 1; |
| 412 | values.resize(structType->mMembers.size()); |
| 413 | for (int i = (int)values.size() - 1; i >= 0; i--) |
| 414 | { |
| 415 | if (mBeContext->AreTypesEqual(values[readIdx]->GetType(), structType->mMembers[i].mType)) |
| 416 | { |
| 417 | values[i] = values[readIdx]; |
| 418 | readIdx--; |
| 419 | } |
| 420 | else if (structType->mMembers[i].mType->IsSizedArray()) |
| 421 | { |
| 422 | auto beConst = mBeModule->mAlloc.Alloc<BeConstant>(); |
| 423 | beConst->mType = structType->mMembers[i].mType; |
| 424 | values[i] = beConst; |
| 425 | } |
| 426 | else |
| 427 | { |
| 428 | FatalError("Malformed structure values"); |
| 429 | } |
| 430 | } |
| 431 | } |
| 432 | |
| 433 | void BeIRCodeGen::FixValues(BeStructType* structType, SizedArrayImpl<BeConstant*>& values) |
| 434 | { |
nothing calls this directly
no test coverage detected