Re:Carp: A statically typed Lisp, without a GC, for real-tim...
by andybest on Friday April 13, 2018 @11:18AM
(#16830775)
Interesting, I wasn't aware of the #line directive, thanks!
Yes, you would need to keep track of the source locations for each node in the AST. There is a nice example in the LLVM Kaleidoscope tutorial here: https://llvm.org/docs/tutorial/LangImpl09.html
You might wind up generating a lot of these, but they're really easy to generate as long as you preserve that information all the way through compilation (which I'd assume you'd have to do for LLVM IR regardless).