+ /* Extract copyid from discriminator. */ + unsigned int copyid + = (discr >> DISCR_COPYID_SHIFT) & DISCR_COPYID_MASK; + if (copyid == 0) + continue; + + /* Update max copyid for this location. */ + unsigned int next_copyid = copyid + 1; + if (next_copyid > DISCR_COPYID_MAX) + next_copyid = DISCR_COPYID_MAX; + unsigned int *existing = fn->copyid_alloc->location_map->get (pure_loc); + if (!existing || *existing <= copyid) + fn->copyid_alloc->location_map->put (pure_loc, next_copyid);
... + + /* Extract copyid from discriminator. */ + unsigned int copyid + = (discr >> DISCR_COPYID_SHIFT) & DISCR_COPYID_MASK; + if (copyid == 0) + continue; + + /* Update max copyid for this location. */ + unsigned int next_copyid = copyid + 1; + if (next_copyid > DISCR_COPYID_MAX) + next_copyid = DISCR_COPYID_MAX; + unsigned int *existing = fn->copyid_alloc->location_map->get (pure_loc); + if (!existing || *existing <= copyid) + fn->copyid_alloc->location_map->put (pure_loc, next_copyid); Please refactor this to a function to avoid code duplication. OK with that change. Jan
