This is an archive of the discontinued LLVM Phabricator instance.

[ELF] - Change tokenizer to read tokens "on fly".
AbandonedPublic

Authored by grimar on Feb 6 2017, 1:08 AM.

Details

Reviewers
ruiu
rafael
Summary

Previously LLD linkerscript tokenizer worked with pre-created
list of tokens. That was not optimal, because sometimes tokens values are context dependent.
Like we were not able to parse "5*5" because in previous approach was impossible
to know if that are 3 tokens (math expression) or a single token representing file name mask.

Diff Detail

Event Timeline

grimar created this revision.Feb 6 2017, 1:08 AM
ruiu edited edge metadata.Feb 6 2017, 1:54 PM

I cannot say whether this is a good change or not because this patch does not do anything that is intended to do; it just changed the internal data representation. Can you add enough code to demonstrate that the new internal representation works well for what you want to do?

grimar updated this revision to Diff 87391.Feb 7 2017, 4:10 AM
grimar edited the summary of this revision. (Show Details)
  • Added code that shows we are able to parse expressions like "1+2*4/5" and do not fail.
  • Added comments and testcases for above.
tpimh added a subscriber: tpimh.Feb 8 2017, 11:14 PM
ruiu added a comment.Feb 14 2017, 2:13 PM

I've been thinking about this change, and I'm not in favor of the way this handles input files. Handling input files like this is tricky, and that's why I chose to tokenize all input ahead of time. I want to keep its simplicity. I have a different idea to do this. I'll sent you a patch.

grimar abandoned this revision.Feb 16 2017, 12:32 AM

D29963 landed instead