unwrapReference

This is a small utility function to "unwrap" a Reference that it is wrapped in (multiple) Expression nodes. This will only work on expression that only have one "argument" (such as a unary operator), in order to avoid ambiguous results. This can be useful for data-flow analysis, if you want to quickly retrieve the reference that is affected by an operation. For example in C++ it is common to take an address of a variable and cast it into an appropriate type:

int64_t addr = (int64_t) &a;

When called on the right-hand side of this assignment, this function will return a.