@Override
	public void setLanguage(LanguageTranslator translator, Register mapReg, TaskMonitor monitor)
			throws CancelledException {

		Register newReg = translator.getNewRegister(mapReg);
		if (newReg == null) {
			// register not translated - clear map
			clearAll();
			return;
		}

		if (newReg.isBaseRegister() && !translator.isValueTranslationRequired(mapReg)) {
			return;
		}

		AddressRangeObjectMap<byte[]> newRangeMap = new AddressRangeObjectMap<byte[]>();
		AddressRangeIterator addressRangeIterator = rangeMap.getAddressRangeIterator();
		while (addressRangeIterator.hasNext()) {
			monitor.checkCancelled();
			AddressRange range = addressRangeIterator.next();
			byte[] oldBytes = rangeMap.getObject(range.getMinAddress());
			RegisterValue regValue = new RegisterValue(mapReg, oldBytes);
			regValue = translator.getNewRegisterValue(regValue);
			if (regValue == null || !regValue.hasAnyValue()) {
				continue; // remove value range
			}
			byte[] newBytes = regValue.toBytes();
			newRangeMap.setObject(range.getMinAddress(), range.getMaxAddress(), newBytes);
		}
		rangeMap = newRangeMap;
	}
@see ghidra.program.util.RangeMapAdapter#setLanguage(ghidra.program.util.LanguageTranslator, ghidra.program.model.lang.Register, ghidra.util.task.TaskMonitor)
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/register/InMemoryRangeMapAdapter.java