<div dir="ltr">This parser is mostly an independent component of the linker, and you can swap it entirely later or update incrementally without affecting other parts. That being said, as you might have implied, implementing error recovery is not a priority because writing a linker script is much rarer than writing C or C++. That would be useful though. I originally suggested implementing this parser using yacc/bison (with some error recovery in mind), but eventually I was convinced that we just wanted to have something that is small (so we can write it up quickly), that does not introduce external dependencies or a discussion whether it should be hand-written or generated by a parser generator, and that good enough to parse libc.so (which is a linker script despite its name!), so that we can go on to work on more important features.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jan 28, 2016 at 10:52 AM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Totally a casual comment & I could be totally off: Parser error recovery can be really helpful to users (eg: Clang's error recovery), though (much like using TLS for the general error handling improvements, and my comments there) I expect this is a good first step and better error recovery can be added over time to improve the user experience here.<br><br>As you've said, it's certainly not a terribly easy thing to do great error recovery, and I wouldn't suggest trying to solve everything up-front, for sure.</div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="h5">On Wed, Jan 27, 2016 at 6:44 PM, Rui Ueyama via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5">ruiu created this revision.<br>
ruiu added a reviewer: rafael.<br>
ruiu added a subscriber: llvm-commits.<br>
<br>
Propagating errors back to callers is annoying in recursive descendent<br>
parser because they are naturally constructed as mutually recursive<br>
functions. In this patch, I took a simple approach. The accessors of<br>
the token stream behaves as if they are at EOF once we saw any errors.<br>
It naturally makes all functions to return.<br>
<br>
This is the final change to not use fatal in the linker.<br>
<br>
<a href="http://reviews.llvm.org/D16667" rel="noreferrer" target="_blank">http://reviews.llvm.org/D16667</a><br>
<br>
Files:<br>
  ELF/LinkerScript.cpp<br>
<br>
<br></div></div>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div>
</blockquote></div><br></div>