uselistorder: Thread bit through ValueEnumerator

Canonicalize access to whether to preserve use-list order in bitcode on
a `bool` stored in `ValueEnumerator`.  Next step, expose this as a
`bool` through `WriteBitcodeToFile()`.

llvm-svn: 234956
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.h b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
index b94c370..ba245a3 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
@@ -67,6 +67,7 @@
   bool HasMDString;
   bool HasMDLocation;
   bool HasGenericDebugNode;
+  bool ShouldPreserveUseListOrder;
 
   typedef DenseMap<AttributeSet, unsigned> AttributeGroupMapType;
   AttributeGroupMapType AttributeGroupMap;
@@ -102,7 +103,7 @@
   ValueEnumerator(const ValueEnumerator &) = delete;
   void operator=(const ValueEnumerator &) = delete;
 public:
-  ValueEnumerator(const Module &M);
+  ValueEnumerator(const Module &M, bool ShouldPreserveUseListOrder);
 
   void dump() const;
   void print(raw_ostream &OS, const ValueMapType &Map, const char *Name) const;
@@ -123,6 +124,8 @@
   bool hasMDLocation() const { return HasMDLocation; }
   bool hasGenericDebugNode() const { return HasGenericDebugNode; }
 
+  bool shouldPreserveUseListOrder() const { return ShouldPreserveUseListOrder; }
+
   unsigned getTypeID(Type *T) const {
     TypeMapType::const_iterator I = TypeMap.find(T);
     assert(I != TypeMap.end() && "Type not in ValueEnumerator!");