iverilog/libmisc
Lars-Peter Clausen 5f479cbad4 Store lexical positions in LineInfo
Several source and netlist objects inherit `LineInfo` while separately
storing the lexical position associated with the same source location. This
requires callers to copy the file, line, and lexical position independently.

Add the lexical position to `LineInfo`. Have `set_line()` initialize it when
it is unset, so new objects inherit the complete source location while later
diagnostic location updates preserve their established declaration order.
Initialize the field to `UINT_MAX` so zero remains available as a valid
scanner position and missing initialization is distinguishable. Have
`FILE_NAME()` preserve a more precise identifier position.

Remove constructor parameters that duplicate the position supplied through
`FILE_NAME()`. Use the shared field for identifiers, wires, events, event
triggers, nets, and elaborated events. Assign static class property nets
their declaration location since they previously relied on the standalone
`NetNet` position defaulting to zero.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
2026-07-26 20:14:20 -07:00
..
LineInfo.cc Store lexical positions in LineInfo 2026-07-26 20:14:20 -07:00
LineInfo.h Store lexical positions in LineInfo 2026-07-26 20:14:20 -07:00
StringHeap.cc cppcheck updates 2025-11-23 01:31:14 -08:00
StringHeap.h Remove "using namespace std" from compiler header files and fix the fallout. 2021-11-04 16:55:03 +00:00