Function dmd.funcsem.traverseIndirections
Performs type-based alias analysis between a newly created value and a pre- existing memory reference:
Assuming that a reference A to a value of type ta
was available to the code
that created a reference B to a value of type tb
, it returns whether B
might alias memory reachable from A based on the types involved (either
directly or via any number of indirections in either A or B).
This relation is not symmetric in the two arguments. For example, a
a const(int)
reference can point to a pre-existing int
, but not the other
way round.
Examples
ta, tb, result
const(int)
, int
, false
int
, const(int)
, true
int
, immutable(int)
, false
const(immutable(int)*), immutable(int)*, false // BUG: returns true
Parameters
Name | Description |
---|---|
ta | value type being referred to |
tb | referred to value type that could be constructed from ta |