[PATCH] [PECOFF] Add a pass to ensure the correct ordering of grouped sections.

Rui Ueyama ruiu at google.com
Tue Jun 18 10:25:23 PDT 2013


  I doubt this should be handled in the writer. Currently when the control reaches to the writer, all atoms has been sorted in the desired order by the layout pass, which seems a clean design. Mixing atom ordering in the writer and the layout pass could mess this thing up. Also I don't fee like it's the right way to do that in the atom model.

  Adding Michael to get his input.


================
Comment at: lib/ReaderWriter/PECOFF/GroupedSectionsPass.h:54
@@ +53,3 @@
+namespace {
+bool compareByFileOrdinal(const DefinedAtom *a, const DefinedAtom *b) {
+  return a->file().ordinal() > b->file().ordinal();
----------------
Shankar Kalpathi Easwaran wrote:
> const
It's not a member function.

================
Comment at: lib/ReaderWriter/PECOFF/GroupedSectionsPass.h:10-12
@@ +9,5 @@
+///
+/// \file \brief This pass adds layout-{before,after} references to atoms in
+/// grouped sections, so that they will appear in the correct order in the
+/// output.
+///
----------------
Shankar Kalpathi Easwaran wrote:
> Is this comment doxygen compatible ?
Yeah I think so. Any concerns?

================
Comment at: lib/ReaderWriter/PECOFF/GroupedSectionsPass.h:93
@@ +92,3 @@
+    // is a sorted map.
+    for (auto &i : sectionToHeadAtoms) {
+      StringRef sectionName = i.first;
----------------
Shankar Kalpathi Easwaran wrote:
> are you modifying i ? I dont see that being modified.
Modification of the atoms is done in connectAtoms().


http://llvm-reviews.chandlerc.com/D998



More information about the llvm-commits mailing list