summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Bitcode/Reader/BitcodeReader.h
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-08-05 17:49:48 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2014-08-05 17:49:48 +0000
commit5a511b59c5571097e9cec617873168f55a8f2e0c (patch)
tree08755bde5a2c4060314b11d5580280dfa13d0ffa /llvm/lib/Bitcode/Reader/BitcodeReader.h
parent00c9b6461f65380deed20676147083a6e8c66c3e (diff)
downloadbcm5719-llvm-5a511b59c5571097e9cec617873168f55a8f2e0c.tar.gz
bcm5719-llvm-5a511b59c5571097e9cec617873168f55a8f2e0c.zip
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. llvm-svn: 214899
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.h')
-rw-r--r--llvm/lib/Bitcode/Reader/BitcodeReader.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Reader/BitcodeReader.h b/llvm/lib/Bitcode/Reader/BitcodeReader.h
index a25ab37a4e3..0b3c1c17c49 100644
--- a/llvm/lib/Bitcode/Reader/BitcodeReader.h
+++ b/llvm/lib/Bitcode/Reader/BitcodeReader.h
@@ -22,6 +22,7 @@
#include "llvm/IR/OperandTraits.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/ValueHandle.h"
+#include <deque>
#include <system_error>
#include <vector>
@@ -183,6 +184,7 @@ class BitcodeReader : public GVMaterializer {
/// inserted lazily into functions when they're loaded.
typedef std::pair<unsigned, BasicBlock *> BasicBlockRefTy;
DenseMap<Function *, std::vector<BasicBlockRefTy>> BasicBlockFwdRefs;
+ std::deque<Function *> BasicBlockFwdRefQueue;
/// UseRelativeIDs - Indicates that we are using a new encoding for
/// instruction operands where most operands in the current
OpenPOWER on IntegriCloud