Page MenuHomePhabricator

[ELF] - Linkerscript: cleanup and introduce nextJoined().
AbandonedPublic

Authored by grimar on Sep 30 2016, 8:04 AM.

Details

Reviewers
ruiu
rafael
Summary

Patch do 2 things:

  1. It removes "section header name is empty" error. It looks not possible to get it. I think the only way to have Tok.empty() condition is when next() returns empty token because of error, in that case setError() will do nothing and itself useless.
  2. There are cases when tokens can go in pairs, like "=0xFF" vs "= 0xFF". And we should handle combined and separate forms. I suggest to have some function like nextJoined() to proccess such cases to simplify parsing.

Diff Detail

Event Timeline

grimar updated this revision to Diff 73053.Sep 30 2016, 8:04 AM
grimar retitled this revision from to [ELF] - Linkerscript: cleanup and introduce nextJoined()..
grimar updated this object.
grimar added reviewers: ruiu, rafael.
grimar added subscribers: llvm-commits, grimar, evgeny777.
ruiu added inline comments.Sep 30 2016, 8:17 AM
ELF/LinkerScript.cpp
1658–1661

You removed this error check, so the real delta of this patch is -4 lines. That's probably too small to introduce a new convenient function.

grimar added inline comments.Sep 30 2016, 8:27 AM
ELF/LinkerScript.cpp
1658–1661

I know at least one more case when this function can be usefull.
If we are going to support assigning memory regions one day, it also exist in 2 forms in the wild scripts:

*(.text) } >rom
*(.text) } > rom

Probably there are other cases we do not know about yet.
Generally caller code looks more clean with it then without I think.

grimar abandoned this revision.Oct 4 2016, 2:36 AM