llvm-project
llvm-project copied to clipboard
[WIP][C++ BoundsSafety] Experimental change of how we substitute and compare expressions
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:
x + y->| + | x | y |, where+denotes a binary plus operationx[4].f->| .f | [] | x | 4 |, where.fdenotes a member field access;[]denotes array subscript;
Changing base for a more clear DIFF.