public static ArrayList<Function> getParents(Function function, boolean followThunks) {
		Program program = function.getProgram();
		FunctionManager functionManager = program.getFunctionManager();
		ReferenceManager referenceManager = program.getReferenceManager();
		HashSet<Address> alreadyDone = new HashSet<Address>();
		ArrayList<Function> funcList = new ArrayList<Function>();
		int size = 0;
		Address curAddr = function.getEntryPoint();
		Address[] thunkAddresses = null;
		if (followThunks) {
			thunkAddresses = function.getFunctionThunkAddresses();
			if (thunkAddresses != null) {
				size = thunkAddresses.length;
			}
		}
		int pos = -1;
		for (;;) {
			ReferenceIterator referenceIterator = referenceManager.getReferencesTo(curAddr);
			for (Reference reference : referenceIterator) {
				// monitor.checkCancelled();
				Address fromAddress = reference.getFromAddress();
				if (reference.getReferenceType().isCall()) {
					Function par = functionManager.getFunctionContaining(fromAddress);
					if (par != null) {
						Address entryPoint = par.getEntryPoint();
						if (!alreadyDone.contains(entryPoint)) {
							funcList.add(par);
							alreadyDone.add(entryPoint);
						}
					}
				}
			}
			pos += 1;
			if (pos >= size) {
				break;
			}
			curAddr = thunkAddresses[pos];
		}

		return funcList;
	}
Add the children of the function to the hash family.
@param family the family
@param function the function
@param monitor a task monitor
@throws MemoryAccessException if a function body was inexplicably inaccessible
@throws CancelledException
Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidProgramSeeker.java