private void addChildRelations(Function function, FidHasher hasher,
			Map<Function, FunctionRow> recordMap, ArrayList<ChildRow> children)
			throws CancelledException {
		HashSet<Address> alreadyDone = new HashSet<>();
		Program program = function.getProgram();
		FunctionManager functionManager = program.getFunctionManager();
		ReferenceManager referenceManager = program.getReferenceManager();
		SymbolTable symbolTable = program.getSymbolTable();
		AddressIterator referenceIterator =
			referenceManager.getReferenceSourceIterator(function.getBody(), true);
		for (Address address : referenceIterator) {
			monitor.checkCancelled();
			Instruction instruction = program.getListing().getInstructionAt(address);
			if (instruction != null && instruction.getFlowType().isCall()) {
				Reference[] referencesFrom = referenceManager.getReferencesFrom(address);
				for (Reference reference : referencesFrom) {
					monitor.checkCancelled();
					Address toAddress = reference.getToAddress();
					if (!alreadyDone.contains(toAddress)) {
						Function relation = functionManager.getFunctionContaining(toAddress);
						if (relation != null && relation.isThunk()) {
							relation = relation.getThunkedFunction(true);
						}
						if (relation == null || functionIsExternal(relation)) {
							ChildRow childRow = new ChildRow();
							childRow.toRow = null;
							childRow.symbolName = grabSymbol(symbolTable, toAddress);
							childRow.toAddress = toAddress;
							children.add(childRow);
							searchChildReferenceByName(childRow, childRow.symbolName);
						}
						else {
							FunctionRow relationRow = recordMap.get(relation);
							if (relationRow != null) {
								ChildRow childRow = new ChildRow();
								childRow.toRow = relationRow;
								childRow.symbolName = null;
								childRow.toAddress = toAddress;
								children.add(childRow);
								searchChildReferenceByName(childRow, relationRow.name);
							}
							// if the relation record was null, 99.99% sure that the
							// relation is too small to hash, so it will appear in the
							// additional labels section
						}
						alreadyDone.add(toAddress);
					}
				}
			}
		}
	}
Collects the child relations of a function in a ChildRow array.
@param function the function
@param hasher the FID hasher
@param recordMap the map of functions to function rows
@param children accumulates ChildRow objects
@throws CancelledException if the user cancels
Ghidra/Features/FunctionID/src/main/java/ghidra/feature/fid/service/FidServiceLibraryIngest.java