llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

[WIP][C++ BoundsSafety] Experimental change of how we substitute and compare expressions

Open ziqingluo-90 opened this issue 1 year ago • 1 comments

The basic idea is to create a wrapper class that owns a container holding AST nodes. With that, substitution can be done by manipulating the container. This implementation uses a list to hold sequentialized Exprs.

With extra handling of DREs representing MemExprs, the implementation guarantees that if two expressions are equivalent, their sequentialized representation will have the same number of elements. Then the comparison can be done element-wise.

Examples of sequentialized expressions:

  1. x + y -> | + | x | y |, where + denotes a binary plus operation
  2. x[4].f -> | .f | [] | x | 4 | , where .f denotes a member field access; [] denotes array subscript;

ziqingluo-90 avatar Aug 08 '25 07:08 ziqingluo-90

Changing base for a more clear DIFF.

ziqingluo-90 avatar Aug 29 '25 23:08 ziqingluo-90