[PATCH] D43254: Use LLVM's DenseSet insteead of unordered_set.

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 13:49:30 PST 2018


ruiu added inline comments.


================
Comment at: lld/wasm/SymbolTable.cpp:37
 void SymbolTable::reportRemainingUndefines() {
-  std::unordered_set<Symbol *> Undefs;
+  DenseSet<Symbol *> Undefs;
   for (Symbol *Sym : SymVector) {
----------------
efriedma wrote:
> ruiu wrote:
> > efriedma wrote:
> > > Don't you need a SetVector here?
> > Forgive my ignorance, but what's the difference between DenseSet and SetVector?
> Iterating over a SetVector produces values in the order they were inserted; iterating over a DenseSet uses an arbitrary ordering.  See http://llvm.org/docs/ProgrammersManual.html#llvm-adt-setvector-h .
Ah, thanks. This code is to produce error messages, so the order of the output of this code doesn't have to be deterministic, but it is still nice if it's deterministic. I'll make a change to use SetVector.


https://reviews.llvm.org/D43254





More information about the llvm-commits mailing list