public void initSignatureSource(TaskMonitor monitor) throws CancelledException, IOException {

		PrototypeModel defaultConvention = getDefaultCallingConvention();

		FunctionIterator functions = getFunctions(false);
		while (functions.hasNext()) {
			monitor.checkCancelled();

			// Establish signature source
			FunctionDB func = (FunctionDB) functions.next();
			func.setSignatureSource(func.getInferredSignatureSource());

			// Check to see if non-custom storage matches since it is preferred over custom
			PrototypeModel callingConvention = func.getCallingConvention();
			if (callingConvention == null) {
				callingConvention = defaultConvention;
			}
			if (callingConvention == null) {
				continue;
			}

			boolean useDynamic = false;
			DataType returnDataType = func.getReturnDataType();
			Parameter[] params = func.getParameters();

// TODO: this does not address return-storage-ptr auto-param case which will likely use custom-storage
			VariableStorage returnStorage = null;
			if (CompilerSpec.CALLING_CONVENTION_thiscall.equals(func.getCallingConventionName())) {
				if (params.length != 0 && isLikelyThisParam(params[0])) {
					returnStorage =
						checkDynamicStorageConversion(returnDataType, params, 1, callingConvention);
					if (returnStorage == null) {
						useDynamic = true;
						func.removeVariable(params[0]);
					}
				}
			}
			else {
				returnStorage =
					checkDynamicStorageConversion(returnDataType, params, 0, callingConvention);
				useDynamic = (returnStorage == null);
			}

			if (useDynamic) {
				func.setCustomVariableStorage(false);
				continue;
			}

			// Since custom storage is used (upgrade default) establish custom return storage
			if (returnStorage != null && !returnStorage.isUnassignedStorage()) {
				func.setReturnStorageAndDataType(returnStorage, returnDataType);
			}
		}
	}
Initialize function signature source when it was first introduced and attempt to
disable custom storage if possible.
NOTE: This method intended to be called by ProgramDB only during appropriate upgrade.
@param monitor
@throws CancelledException
@throws IOException
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/function/FunctionManagerDB.java