aboutsummaryrefslogtreecommitdiffstats
path: root/xcomp
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-01-30 07:21:52 +0100
committerBjörn Gustavsson <[email protected]>2016-02-03 10:23:02 +0100
commit4f567ddbe4eccfb4803a94675207efc65199615b (patch)
tree698882e343fc3cd536e18b8eeb071d581566095f /xcomp
parent2f8d51915c3dff7e95c62820b6f7c0ce2ff5ef5a (diff)
downloadotp-4f567ddbe4eccfb4803a94675207efc65199615b.tar.gz
otp-4f567ddbe4eccfb4803a94675207efc65199615b.tar.bz2
otp-4f567ddbe4eccfb4803a94675207efc65199615b.zip
v3_core: Eliminate double processing of patterns
Internally in the v3_core pass, an #imatch{} record represents a match expression: Pattern = Expression If Pattern is a single, unbound variable, #imatch{} will be rewritten to #iset{}; otherwise it will be rewritten to #icase{}. To determine how #imatch{} should be translated, the pattern is processed using upattern/3. The return value from upattern/3 is thrown away (after having been used for determing how the #imatch{} record should be translated). That means that every pattern in an #imatch{} is processed twice, which is wasteful. We can easily avoid the double processing of patterns by introducing a new helper function that determines whether the pattern is a new variable.
Diffstat (limited to 'xcomp')
0 files changed, 0 insertions, 0 deletions