public VariableStorage[] getStorageLocations(Program program, DataType[] dataTypes,
			boolean addAutoParams) {

		DataType injectedThis = null;
		if (addAutoParams && hasThis) {
			// explicit support for auto 'this' parameter
			// must inject pointer arg to obtain storage assignment
			injectedThis = new PointerDataType(program.getDataTypeManager());
		}
		PrototypePieces proto = new PrototypePieces(this, dataTypes, injectedThis);

		ArrayList<ParameterPieces> res = new ArrayList<>();
		assignParameterStorage(proto, program.getDataTypeManager(), res, addAutoParams);
		VariableStorage[] finalres = new VariableStorage[res.size()];

		for (int i = 0; i < finalres.length; ++i) {
			finalres[i] = res.get(i).getVariableStorage(program);
		}
		return finalres;
	}
Compute the variable storage for a given array of return/parameter datatypes.  The first array element
is the return datatype, which is followed by any input parameter datatypes in order.
If addAutoParams is true, pointer datatypes will automatically be inserted for "this" or "hidden return"
input parameters, if needed.  In this case, the dataTypes array should not include explicit entries for
these parameters.  If addAutoParams is false, the dataTypes array is assumed to already contain explicit
entries for any of these parameters.
<br>
Note: storage will not be assigned to the {@link DataType#DEFAULT default undefined} datatype
or zero-length datatypes or any subsequent parameter following such a parameter.

@param program is the Program
@param dataTypes return/parameter datatypes (first element is always the return datatype, 
i.e., minimum array length is 1)
@param addAutoParams true if auto-parameter storage locations can be generated
@return dynamic storage locations orders by ordinal where first element corresponds to
return storage. The returned array may also include additional auto-parameter storage 
locations.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/lang/PrototypeModel.java