Position in a source file; pass around as value.
We are only using uint16_t for row/col because this allows us to have sizeof(Loc) == 16: two machine words, which common 64 bit calling conventions (x86-64 System V, AArch64) still pass and return in registers - with uint32_t, every Loc would go through memory instead.
- Warning
- Rows/cols beyond 65535 wrap around - and row 0 doubles as the "invalid" sentinel, so Positions in such files silently degrade to invalid/wrong ones.
Definition at line 15 of file loc.h.
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
Pos | pos ) |
|
friend |
fe/loc.h only declares the stream output and dump helpers.
Include fe/loc.cpp.h in exactly one translation unit for the default implementation, or provide your own definitions instead.
Definition at line 10 of file loc.cpp.h.
References col, Pos(), and row.