@Override
	public int compareTo(ProgramLocation pl) {
		if (pl instanceof VariableLocation) {
			if (pl.getClass() == this.getClass() && pl.getAddress().equals(getAddress())) {
				// only compare here is not the same variable within the same function
				// otherwise defer to super
				VariableLocation otherLoc = (VariableLocation) pl;
				if (isParameter) {
					if (!otherLoc.isParameter) {
						return -1;
					}
					int retVal = ordinalOrfirstUseOffset - otherLoc.ordinalOrfirstUseOffset;
					if (retVal != 0) {
						return retVal;
					}
				}
				else {
					if (otherLoc.isParameter) {
						return 1;
					}
					// nulls may be returned for non-existing variables
					// which can't be compared against
					Variable var = getVariable();
					Variable otherVar = otherLoc.getVariable();
					if (var == null) {
						if (otherVar != null) {
							return 1;
						}
					}
					else if (otherVar == null) {
						return -1;
					}
					else {
						return var.compareTo(otherVar);
					}
				}
			}
		}
		return super.compareTo(pl);
	}
Checks to see if this location is for the indicated variable.
@param var the variable
@return true if this location is for the specified variable.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/util/VariableLocation.java