[PATCH] [Layout] Assign ordinals in resolution order

Shankar Kalpathi Easwaran shankarke at gmail.com
Tue Oct 8 22:15:12 PDT 2013



================
Comment at: include/lld/Core/File.h:80
@@ -82,1 +79,3 @@
+  /// Sets the command line order of the file.
+  virtual void setOrdinal(uint64_t ordinal) const { _ordinal = ordinal; }
 
----------------
Rui Ueyama wrote:
> Why virtual?
Will remove virtual.

================
Comment at: lib/Core/Resolver.cpp:306
@@ +305,3 @@
+    if (nextFile->kind() == File::kindArchiveLibrary) {
+      if (nextFile->getOrdinal() != (uint64_t)(-1))
+        nextFile->setOrdinal(_context.getNextOrdinalAndIncrement());
----------------
Rui Ueyama wrote:
> I'd define File::hasOrdinal() and move this comparison into that function.
yes that makes sense.

================
Comment at: lib/Core/Resolver.cpp:302
@@ -299,1 +301,3 @@
+    if (nextFile->kind() == File::kindObject) {
+      nextFile->setOrdinal(_context.getNextOrdinalAndIncrement());
       handleFile(*nextFile);
----------------
Rui Ueyama wrote:
> Don't you need to check if an ordinal has already been assigned?
no there is no need do that for files. If its an object file, the resolver shouldnt see the same file again.


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



More information about the llvm-commits mailing list