private Set<Function> filterFunctions(Program program, DataType dt, TaskMonitor monitor)
			throws CancelledException {

		Set<DataType> types = new HashSet<>();
		buildTypeLineage(dt, types);

		Set<Function> results = new HashSet<>();
		accumulateFunctionCallsToDefinedData(program, dt, types, results, monitor);

		Listing listing = program.getListing();
		FunctionIterator it = listing.getFunctions(true);
		for (Function f : it) {
			monitor.checkCancelled();
			if (results.contains(f)) {
				continue;
			}

			if (usesAnyType(f, types)) {
				results.add(f);
			}
		}

		// note: do this here, so that don't cause the code above to skip processing these functions
		Set<Function> callers = new HashSet<>();
		for (Function f : results) {
			monitor.checkCancelled();
			Set<Function> callingFunctions = f.getCallingFunctions(monitor);
			callers.addAll(callingFunctions);
		}

		results.addAll(callers);
		
		// Add any callers to external function that use any form of the data type
		it = listing.getExternalFunctions();
		callers = new HashSet<>();
		for (Function f : it) {
			monitor.checkCancelled();

			if (usesAnyType(f, types)) {
				Set<Function> callingFunctions = f.getCallingFunctions(monitor);
				callers.addAll(callingFunctions);
			}
		}
		
		results.addAll(callers);

		return results;
	}
Implementation of {@link DataTypeReferenceFinder} that uses the Decompiler's output
to find data type and composite field usage.
Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/extension/datatype/finder/DecompilerDataTypeReferenceFinder.java