MCPcopy Create free account
hub / github.com/beefytech/Beef / RemoveInst

Method RemoveInst

IDEHelper/Backend/BeMCContext.cpp:2777–2803  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2775}
2776
2777void BeMCContext::RemoveInst(BeMCBlock* block, int instIdx, bool needChangesMerged, bool removeFromList)
2778{
2779 // If neither the instruction before or after this one shares the vregsInitialized flags, then we need to
2780 // merge down our Changes to the next instruction
2781 auto inst = block->mInstructions[instIdx];
2782 if (instIdx > 0)
2783 {
2784 auto prevInst = block->mInstructions[instIdx - 1];
2785 if (prevInst->mVRegsInitialized == inst->mVRegsInitialized)
2786 needChangesMerged = false;
2787 }
2788
2789 if (needChangesMerged)
2790 {
2791 if (instIdx < (int)block->mInstructions.size() - 1)
2792 {
2793 auto nextInst = block->mInstructions[instIdx + 1];
2794 if ((inst->mVRegsInitialized != NULL) && (nextInst->mVRegsInitialized != NULL))
2795 {
2796 nextInst->mVRegsInitialized = mVRegInitializedContext.MergeChanges(nextInst->mVRegsInitialized, inst->mVRegsInitialized);
2797 }
2798 }
2799 }
2800
2801 if (removeFromList)
2802 block->mInstructions.RemoveAt(instIdx);
2803}
2804
2805BeMCOperand BeMCContext::GetCallArgVReg(int argIdx, BeTypeCode typeCode)
2806{

Callers

nothing calls this directly

Calls 3

MergeChangesMethod · 0.80
sizeMethod · 0.45
RemoveAtMethod · 0.45

Tested by

no test coverage detected