[lld] r303707 - Don't do a full scan of the type stream before processing records.

Zachary Turner via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 17:26:27 PDT 2017


Author: zturner
Date: Tue May 23 19:26:27 2017
New Revision: 303707

URL: http://llvm.org/viewvc/llvm-project?rev=303707&view=rev
Log:
Don't do a full scan of the type stream before processing records.

LazyRandomTypeCollection is designed for random access, and in
order to provide this it lazily indexes ranges of types.  In the
case of types from an object file, there is no partial index
to build off of, so it has to index the full stream up front.
However, merging types only requires sequential access, and when
that is needed, this extra work is simply wasted.  Changing the
algorithm to work on sequential arrays of types rather than
random access type collections eliminates this up front scan.

Modified:
    lld/trunk/COFF/PDB.cpp

Modified: lld/trunk/COFF/PDB.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/COFF/PDB.cpp?rev=303707&r1=303706&r2=303707&view=diff
==============================================================================
--- lld/trunk/COFF/PDB.cpp (original)
+++ lld/trunk/COFF/PDB.cpp Tue May 23 19:26:27 2017
@@ -117,9 +117,8 @@ static void mergeDebugT(SymbolTable *Sym
     Handler.addSearchPath(llvm::sys::path::parent_path(File->getName()));
     if (auto EC = Reader.readArray(Types, Reader.getLength()))
       fatal(EC, "Reader::readArray failed");
-    codeview::LazyRandomTypeCollection TypesAndIds(Types, 100);
     if (auto Err = codeview::mergeTypeAndIdRecords(
-            IDTable, TypeTable, SourceToDest, &Handler, TypesAndIds))
+            IDTable, TypeTable, SourceToDest, &Handler, Types))
       fatal(Err, "codeview::mergeTypeStreams failed");
   }
 




More information about the llvm-commits mailing list