private void buildTypeLineage(DataType sourceType, Set<DataType> types) {

		if (types.contains(sourceType)) {
			return; // already processed
		}

		// First, get this type, which could be a pointer, typedef or array...
		gatherRelatedTypes(sourceType, types);

		// Then, check the base type
		DataType baseType = DataTypeUtils.getBaseDataType(sourceType);
		if (types.contains(baseType)) {
			return;
		}

		// We have a different type, should we search for it?
		if (baseType instanceof BuiltInDataType) {
			// When given a wrapper type (e.g., typedef) , ignore built-ins (e.g., int, byte, etc),
			// as they will be of little value due to their volume in the program and the user
			// *probably* did not intend to search for them.  (Below we do not do this check, which
			// allows the user to search directly for a built-in type, if they wish.)
			return;
		}

		gatherRelatedTypes(baseType, types);
	}
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