BitcodeReader: Fix non-determinism in use-list order
[oota-llvm.git] / lib / Bitcode / Reader / BitcodeReader.h
index a25ab37a4e306063cacb3df1a4eefc1a76c13b0b..0b3c1c17c49e3ffa97d349c7873adc88d2eed7c6 100644 (file)
@@ -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