Set ordinals correctly.

This actually doesn't change behavior with the current LinkerInvocation, but
it's needed when you make reading parallel.

llvm-svn: 177554
diff --git a/lld/lib/ReaderWriter/ReaderArchive.cpp b/lld/lib/ReaderWriter/ReaderArchive.cpp
index c31b955..370348b 100644
--- a/lld/lib/ReaderWriter/ReaderArchive.cpp
+++ b/lld/lib/ReaderWriter/ReaderArchive.cpp
@@ -52,7 +52,7 @@
 
     assert(result.size() == 1);
 
-    // TO DO: set ordinal of child just loaded
+    result[0]->setOrdinalAndIncrement(_curChildOrd);
 
     // give up the pointer so that this object no longer manages it
     return result[0].release();
@@ -60,6 +60,7 @@
 
   virtual void setOrdinalAndIncrement(uint64_t &ordinal) const {
     _ordinal = ordinal++;
+    _curChildOrd = _ordinal;
     // Leave space in ordinal range for all children
     for (auto mf = _archive->begin_children(),
               me = _archive->end_children(); mf != me; ++mf) {
@@ -126,6 +127,7 @@
   atom_collection_vector<UndefinedAtom>     _undefinedAtoms;
   atom_collection_vector<SharedLibraryAtom> _sharedLibraryAtoms;
   atom_collection_vector<AbsoluteAtom>      _absoluteAtoms;
+  mutable uint64_t _curChildOrd;
 
 public:
   /// only subclasses of ArchiveLibraryFile can be instantiated