/** * Figure out where to insert an entry in a list of twins. */ LOCAL tDefEntry* findPlace(char* name, char const * pzIndex) { tDefEntry* pE = getEntry(); pE->pzDefName = name; if (pzIndex == NULL) pE->index = NO_INDEX; else if (IS_DEC_DIGIT_CHAR(*pzIndex) || (*pzIndex == '-')) pE->index = strtol(pzIndex, NULL, 0); else { pzIndex = getDefine(pzIndex, AG_TRUE); if (pzIndex != NULL) pE->index = strtol(pzIndex, NULL, 0); else pE->index = NO_INDEX; } strtransform(pE->pzDefName, pE->pzDefName); pE->valType = VALTYP_UNKNOWN; pE->pzSrcFile = (char*)pCurCtx->pzCtxFname; pE->srcLineNum = pCurCtx->lineNo; return (pCurrentEntry = insertDef(pE)); }
void MemorySSAUpdater::moveTo(MemoryUseOrDef *What, BasicBlock *BB, WhereType Where) { // Replace all our users with our defining access. What->replaceAllUsesWith(What->getDefiningAccess()); // Let MemorySSA take care of moving it around in the lists. MSSA->moveTo(What, BB, Where); // Now reinsert it into the IR and do whatever fixups needed. if (auto *MD = dyn_cast<MemoryDef>(What)) insertDef(MD); else insertUse(cast<MemoryUse>(What)); }