public virtual Differences VisitAddressDereference(AddressDereference/*!*/ addr1, AddressDereference addr2) {
      Differences differences = new Differences(addr1, addr2);
      if (addr1 == null || addr2 == null){
        if (addr1 != addr2) differences.NumberOfDifferences++; else differences.NumberOfSimilarities++;
        return differences;
      }
      AddressDereference changes = (AddressDereference)addr2.Clone();
      AddressDereference deletions = (AddressDereference)addr2.Clone();
      AddressDereference insertions = (AddressDereference)addr2.Clone();
  
      Differences diff = this.VisitExpression(addr1.Address, addr2.Address);
      if (diff == null){Debug.Assert(false); return differences;}
      changes.Address = diff.Changes as Expression;
      deletions.Address = diff.Deletions as Expression;
      insertions.Address = diff.Insertions as Expression;
      Debug.Assert(diff.Changes == changes.Address && diff.Deletions == deletions.Address && diff.Insertions == insertions.Address);
      differences.NumberOfDifferences += diff.NumberOfDifferences;
      differences.NumberOfSimilarities += diff.NumberOfSimilarities;

      if (addr1.Alignment == addr2.Alignment) differences.NumberOfSimilarities++; else differences.NumberOfDifferences++;
      if (addr1.Volatile == addr2.Volatile) differences.NumberOfSimilarities++; else differences.NumberOfDifferences++;

      if (differences.NumberOfDifferences == 0){
        differences.Changes = null;
        differences.Deletions = null;
        differences.Insertions = null;
      }else{
        differences.Changes = changes;
        differences.Deletions = deletions;
        differences.Insertions = insertions;
      }
      return differences;
    }
Exemple #2
0
 public override Expression VisitAddressDereference(AddressDereference addr)
 {
     if (addr == null) return null;
     return base.VisitAddressDereference((AddressDereference)addr.Clone());
 }