public Map<Address, RecoveredClass> getReferenceToClassMap(RecoveredClass recoveredClass,
			Function function) throws CancelledException {

		Map<Address, RecoveredClass> referenceToParentMap = new HashMap<Address, RecoveredClass>();

		List<Address> vftableRefs = functionToVftableRefsMap.get(function);

		if (vftableRefs == null) {
			return referenceToParentMap;
		}

		// iterate through all vftable refs in the function and add it to ref/Parent map
		for (Address vftableRef : vftableRefs) {

			monitor.checkCancelled();

			Address vftableAddress = extendedFlatAPI.getSingleReferencedAddress(vftableRef);

			if (vftableAddress == null) {
				continue;
			}

			RecoveredClass parentClass = vftableToClassMap.get(vftableAddress);
			referenceToParentMap.put(vftableRef, parentClass);
		}

		// remove duplicate vftable refs (occasionally there are LEA then MOV of same vftable address
		// a few intructions of each other. It confuses later processes to have both.
		referenceToParentMap = dedupeMap(referenceToParentMap);

		// loop through all the ref add/func pairs of called constructors/destructors in the function
		// and get the class the constructor/destructor belongs to and add the ref/Parent pair to the
		// same map as the vftable refs above
		Map<Address, Function> functionCallMap = getFunctionCallMap(function, true);

		// if no calls then just return the ones found in the vftable section above
		if (functionCallMap.isEmpty()) {
			return referenceToParentMap;
		}

		for (Address address : functionCallMap.keySet()) {
			monitor.checkCancelled();

			Function calledFunction = functionCallMap.get(address);

			// skip the call reg case
			if (calledFunction == null) {
				continue;
			}

			// skip if the called function doesn't have any references to a vftable (ie won't 
			// be a constructor or destructor in that case)
			if (getVftableReferences(calledFunction) == null) {
				continue;
			}

			RecoveredClass ancestorClass =
				getAncestorClassWithGivenFunction(recoveredClass, calledFunction);

			if (ancestorClass == null) {
				continue;
			}

			referenceToParentMap.put(address, ancestorClass);
		}

		return referenceToParentMap;
	}
Method to create a map of all references to classes in the given function. Classes are, for 
this purpose, referenced if they a vftable belonging to a class is referenced or if a 
constructor/destructor function from a class is called
@param recoveredClass the given class
@param function the given function
@return Map of Address references to Class object for the given function
@throws CancelledException when cancelled
Ghidra/Features/Decompiler/ghidra_scripts/classrecovery/RecoveredClassHelper.java