private static Data setGlobalDataType(HighSymbol global, DataType dt)
			throws InvalidInputException {
		Program program = global.getHighFunction().getFunction().getProgram();
		VariableStorage storage = global.getStorage();
		if (!storage.isMemoryStorage()) {
			return null;
		}
		Address addr = storage.getFirstVarnode().getAddress();
		Listing listing = program.getListing();
		Data d = listing.getDataAt(addr);
		if (d != null && d.getDataType().isEquivalent(dt)) {
			return d;
		}

		try {
			return DataUtilities.createData(program, addr, dt, -1,
				DataUtilities.ClearDataMode.CHECK_FOR_SPACE);
		}
		catch (CodeUnitInsertionException e) {
			// Recast as InvalidInput
			throw new InvalidInputException(e.getMessage());
		}
	}
Rename and/or retype the specified variable in the database.  All parameters may be flushed
to the database if typed parameter inconsistency detected.
@param highSymbol is the symbol being updated
@param name new variable name or null to use retain current variable name
@param dataType newly assigned data type or null to retain current variable datatype.
Only a fixed-length data type may be specified.  If size varies from the current size,
an attempt will be made to grow/shrink the storage.
@param source source type
@throws InvalidInputException if suitable data type was not specified, or unable to
resize storage, or invalid name specified
@throws DuplicateNameException if name was specified and conflicts with another
variable/label within the function's namespace
@throws UnsupportedOperationException if unsupported variable type is specified
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/pcode/HighFunctionDBUtil.java