Simplify SORT and --sort-section command line option handling.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
My comments below, every of them is just an IMHO of course.
ELF/LinkerScript.cpp | ||
---|---|---|
169 ↗ | (On Diff #71700) | So you can call sortSections() or not call it, and function itself can I understand why you had to do all that, but it is much |
189 ↗ | (On Diff #71700) | This comment says nothing about how rules are applied, I can't say the same for this code though. |
1012 ↗ | (On Diff #71700) | By the way this place did not need the comment before renaming IgnoreConfig to None, I think code on the left side (if take version before renaming) is much more readable without need of in-mind-debugging. |
I do like this new one better, but I think it needs a few more comments.
In particular, mention that the command line replaces the inner sort if not set explicitly.
BTW, this and the previous code would crash if SORT_NONE was the inner sort, no?
ELF/LinkerScript.cpp | ||
---|---|---|
165 ↗ | (On Diff #71700) | static |
George, I think this is better as it directly works on data structure we'd like to sort, rather than creating directives, fix it in the second pass, and then apply them. I updated the comment to describe how it works. Don't you still dislike this?