aliases
Simple alias analysis for the HLO and the code generators.
Imports
Types
Procs
proc isPartOf(a, b: PNode): TAnalysisResult {...}{. raises: [Exception, ERecoverableError], tags: [RootEffect].}
-
checks if location
a
can be part of locationb
. We treat seqs and strings as pointers because the code gen often just passes them as such.Note:
a
can only be part ofb
, ifa
's type can be part ofb
's type. Since however type analysis is more expensive, we perform it only if necessary.cases:
- YES-cases:
- x <| x # for general trees x[] <| x x[i] <| x x.f <| x
NO-cases: x !<| y # depending on type and symbol kind x[constA] !<| x[constB] x.f !<| x.g x.f !<| y.f iff x !<= y
MAYBE-cases:
x[] ?<| y[] iff compatible type
x[] ?<| y depending on type
© 2006–2021 Andreas Rumpf
Licensed under the MIT License.
https://nim-lang.org/docs/compiler/aliases.html