public final Reference createMemoryReference(Instruction instruction, int operandIndex,
			Address toAddress, RefType flowType) {
		ReferenceManager referenceManager = currentProgram.getReferenceManager();
		Reference ref = referenceManager.addMemoryReference(instruction.getMinAddress(), toAddress,
			flowType, SourceType.USER_DEFINED, operandIndex);
		return ref;
	}
Creates a memory reference from the given instruction.
@param instruction the instruction
@param operandIndex the operand index on the instruction
@param toAddress the TO address
@param flowType the flow type of the reference
@return the newly created memory reference
Ghidra/Features/Base/src/main/java/ghidra/program/flatapi/FlatProgramAPI.java