This is an archive of the discontinued LLVM Phabricator instance.

Add line number to error message.
AbandonedPublic

Authored by ruiu on Mar 29 2016, 10:35 AM.

Details

Reviewers
ruiu

Diff Detail

Event Timeline

ruiu updated this revision to Diff 51947.Mar 29 2016, 10:35 AM
ruiu retitled this revision from to Add line number to error message..
ruiu updated this object.
ruiu added a reviewer: ruiu.
emaste added a subscriber: emaste.Mar 29 2016, 10:55 AM

Nice, since we don't need the line count in the usual case anyway.

grimar added a subscriber: grimar.Mar 30 2016, 6:47 AM

Nice. Can have problems with peek() though as

const char *Tok = Tokens[Pos - 1].data();

will return the previous token in code like:

StringRef E = peek();
if (E == "foo")
  error("bar");
grimar added a comment.EditedMar 30 2016, 7:06 AM

I checked the testcase, fixed it (line numeration in mine started from 0. bfd/gold start from 1 like in your code).
And updated the patch, so you can commit it if you think the test is ok itself.

ruiu abandoned this revision.Mar 30 2016, 9:57 AM
ruiu edited edge metadata.

Committed as r264878.

In D18563#387099, @ruiu wrote:

Committed as r264878.

Thanks !