[LLVMdev] clang's lazy line number detection

deadal nix deadalnix at gmail.com
Thu Jun 4 01:09:57 PDT 2015


I was wondering, looking into clang, it seems that line number are computed
lazily, instead of during lexing and stored in Locations as it is often
done.

The benefit seems obvious: Location can be smaller and they are all over
the place, it is a win. But at the same time, it forces the compiler to go
over the file twice, and the file is probably gone from the cache by the
time you request a line number (or is it ?).

Anyway, I was wondering why this design decision, if benchmark were done at
the time or if there are reason I didn't understood.

Thanks in advance for your answers.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150604/1e529dab/attachment.html>


More information about the llvm-dev mailing list