private String getCallingConvention(Function function, CompilerSpec compilerSpec) {

		// Ignore signature's calling convention if unknown/not-defined
		String callingConvention = signature.getCallingConventionName();
		if (compilerSpec.getCallingConvention(callingConvention) == null) {
			callingConvention = null;
		}

		// Continue using function's current calling convention if valid and either
		// reservation was requested or signature's convention is unknown/not-defined.
		PrototypeModel currentConvention = function.getCallingConvention();
		if (currentConvention != null && (callingConvention == null || preserveCallingConvention)) {
			callingConvention = function.getCallingConventionName();
		}

		return callingConvention;
	}
Sets a function's signature in the program using the command details.
@param func the function
Ghidra/Features/Base/src/main/java/ghidra/app/cmd/function/ApplyFunctionSignatureCmd.java