public static DataType getAutoDataType(Function function, DataType returnDataType,
			VariableStorage storage) {

		AutoParameterType autoParameterType = storage.getAutoParameterType();
		if (autoParameterType == AutoParameterType.THIS) {
			DataType classStruct = findOrCreateClassStruct(function);
			if (classStruct == null) {
				classStruct = VoidDataType.dataType;
			}
			return getPointer(function.getProgram(), classStruct, storage.size());
		}
		else if (autoParameterType == AutoParameterType.RETURN_STORAGE_PTR) {
			return getPointer(function.getProgram(), returnDataType, storage.size());
		}
		return Undefined.getUndefinedDataType(storage.size());
	}
Determine the appropriate data type for an automatic parameter
@param function function whose auto param datatype is to be determined
@param returnDataType function's formal return datatype
@param storage variable storage for an auto-parameter (isAutoStorage should be true)
@return auto-parameter data type
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/listing/VariableUtilities.java