public static DataType getFieldDataType(ClangFieldToken field) {
		DataType fieldDt = field.getDataType();
		fieldDt = DecompilerReference.getBaseType(fieldDt);
		if (fieldDt instanceof Structure parent) {
			int offset = field.getOffset();
			int n = parent.getLength();
			if (offset >= 0 && offset < n) {
				DataTypeComponent dtc = parent.getComponentContaining(field.getOffset());
				if (dtc != null) {
					return dtc.getDataType();
				}
			}
		}
		else if (fieldDt instanceof Union union) {

			String fieldName = field.getText();
			int n = union.getNumComponents();
			for (int i = 0; i < n; i++) {
				DataTypeComponent unionDtc = union.getComponent(i);
				String dtcName = unionDtc.getFieldName();
				if (fieldName.equals(dtcName)) {
					return unionDtc.getDataType();
				}
			}
		}

		return fieldDt;
	}
Scan this reference for any data type matches.
<p>
The {@code fieldName} is optional.  If not included, then only data type matches will
be sought.  If it is included, then a match is only included when it is a reference
to the given data type where that type is being accessed by the given field name.

@param dt the data type to find
@param fieldMatcher the optional field matcher used to restrict matches.
@param results the accumulator object into which will be placed any matches
Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/extension/datatype/finder/DecompilerReference.java