public static Set<Reference> getAllXrefs(ProgramLocation location) {

		CodeUnit cu = DataUtilities.getDataAtLocation(location);
		if (cu == null) {
			Address toAddress = location.getAddress();
			Listing listing = location.getProgram().getListing();
			cu = listing.getCodeUnitContaining(toAddress);
		}

		if (cu == null) {
			return Collections.emptySet();
		}

		List<Reference> xrefs = getXReferences(cu, ALL_REFS);
		List<Reference> offcuts = getOffcutXReferences(cu, ALL_REFS);

		// Remove duplicates
		Set<Reference> set = new HashSet<>();
		set.addAll(xrefs);
		set.addAll(offcuts);
		return set;
	}
Returns all xrefs to the given location.  If in data, then xrefs to the specific data
component will be returned.  Otherwise, the code unit containing the address of the
given location will be used as the source of the xrefs.

@param location the location for which to get xrefs
@return the xrefs
Ghidra/Features/Base/src/main/java/ghidra/app/util/XReferenceUtils.java