diff options
author | Björn Gustavsson <[email protected]> | 2012-01-03 13:44:17 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-03-14 11:04:45 +0100 |
commit | 982ce043282cfa9f118f13ce8b3abd989fa0c0f8 (patch) | |
tree | b26d42c5fc60225fec3c3a2323aef68034443b2e /lib/compiler/src/v3_core.erl | |
parent | 084b34086f8f2cf6bc7aa0075f82a487d161cc72 (diff) | |
download | otp-982ce043282cfa9f118f13ce8b3abd989fa0c0f8.tar.gz otp-982ce043282cfa9f118f13ce8b3abd989fa0c0f8.tar.bz2 otp-982ce043282cfa9f118f13ce8b3abd989fa0c0f8.zip |
v3_core: Don't put negative line numbers in annotations
In Core Erlang and later passes, compiler-generated code can be
indicated in two different ways: by negative line numbers and by
a 'compiler_generated' annotation.
Simplify the code and improve coverage by turning negative line
numbers positive and adding a 'compiler_generated' annotation in
the v3_core pass. That means that Core Erlang and latter passes
do not have deal with negative line numbers.
Diffstat (limited to 'lib/compiler/src/v3_core.erl')
-rw-r--r-- | lib/compiler/src/v3_core.erl | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/compiler/src/v3_core.erl b/lib/compiler/src/v3_core.erl index 6885405ae0..ad0a8a7654 100644 --- a/lib/compiler/src/v3_core.erl +++ b/lib/compiler/src/v3_core.erl @@ -2085,7 +2085,12 @@ bitstr_vars(Segs, Vs) -> lineno_anno(L, St) -> {line, Line} = erl_parse:get_attribute(L, line), - [Line] ++ St#core.file. + if + Line < 0 -> + [-Line] ++ St#core.file ++ [compiler_generated]; + true -> + [Line] ++ St#core.file + end. get_ianno(Ce) -> case get_anno(Ce) of |