public void replaceDataTypes(Map<Long, Long> dataTypeReplacementMap) {
		lock.acquire();
		try {
			RecordIterator it = adapter.iterateFunctionRecords();
			while (it.hasNext()) {
				DBRecord rec = it.next();

				if (thunkAdapter.getThunkRecord(rec.getKey()) != null) {
					continue; // skip thunks
				}

				long id = rec.getLongValue(FunctionAdapter.RETURN_DATA_TYPE_ID_COL);
				Long replacementId = dataTypeReplacementMap.get(id);
				if (replacementId != null) {
					rec.setLongValue(FunctionAdapter.RETURN_DATA_TYPE_ID_COL, replacementId);
					adapter.updateFunctionRecord(rec);
					FunctionDB functionDB = cache.get(rec);
					if (functionDB == null) {
						functionDB = new FunctionDB(this, cache, addrMap, rec);
					}
					functionChanged(functionDB, RETURN_TYPE_CHANGED);
				}
			}
		}
		catch (IOException e) {
			dbError(e);
		}
		finally {
			cache.invalidate();
			lock.release();
		}
	}
Remove variable references in the given address set.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionManagerDB.java