codeview: Call register_file only when producing line numbers
commit6503051dcc360172c49311d586f2b9cf4ab2ea81
authorFabian Giesen <fabiang@radgametools.com>
Thu, 28 Apr 2016 20:48:16 +0000 (28 13:48 -0700)
committerCyrill Gorcunov <gorcunov@gmail.com>
Sat, 30 Apr 2016 13:01:30 +0000 (30 16:01 +0300)
tree4defd8799b668483d3361214f3a85f8f1d270ddf
parent5b838ef981ba49349ac05656bff335ac5feaba15
codeview: Call register_file only when producing line numbers

Previously, debug info would refer to the first file seen, even
when it did not actually generate line numbers (e.g. segto=-1).

Fix it so we only lock in the file name the first time we actually
produce a line number record. Not as good as proper support for
debug info referencing multiple source files but much more useful
than the current behavior.

Signed-off-by: Fabian Giesen <fabiang@radgametools.com>
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
output/codeview.c