BitcodeReader: Fix non-determinism in use-list order
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 5 Aug 2014 17:49:48 +0000 (17:49 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Tue, 5 Aug 2014 17:49:48 +0000 (17:49 +0000)
commit7f2cd21ddd31d74b25f671e31eb89c0c9775b602
treee427507921c4799bb8dd2b7d5c88378c38f138af
parentb835f3446f20b61c5560eba29afd4025bc15639a
BitcodeReader: Fix non-determinism in use-list order

`BasicBlockFwdRefs` (and `BlockAddrFwdRefs` before it) was being emptied
in a non-deterministic order.  When predicting use-list order I've
worked around this another way, but even when parsing lazily (and we
can't recreate use-list order) use-lists should be deterministic.

Make them so by using a side-queue of functions with forward-referenced
blocks that gets visited in order.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@214899 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Bitcode/Reader/BitcodeReader.cpp
lib/Bitcode/Reader/BitcodeReader.h