bob.wilson added a comment.

I'm excited to see some progress on this, but since there is overhead to adding 
a new hashing scheme, I think we should do more before introducing a new 
scheme. One of the problems with the previous scheme is that is did not take 
into account nesting. Distinguishing an if-statement from an if-else statement 
is good but we also need to distinguish what code is inside the then-block, 
else-block, and the code afterward. As it stands, I believe the following are 
all hashed the same, even with this patch:

Loop after the if-else:

  if (condition1())
    x = 1;
  else
    x = 2;
  while (condition2()) body();

Loop in the else-block:

  if (condition1())
    x = 1;
  else
    while (condition2()) body();

Loop in the then-block:

  if (condition1()) {
    while (condition2()) body();
  } else
    x = 2

It would be good to fix that.


https://reviews.llvm.org/D39446



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to