enumerate parameter attr lists.

llvm-svn: 36709
diff --git a/llvm/lib/Bitcode/Writer/ValueEnumerator.h b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
index 77f27da..d78fdb8 100644
--- a/llvm/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/llvm/lib/Bitcode/Writer/ValueEnumerator.h
@@ -24,6 +24,7 @@
 class BasicBlock;
 class Function;
 class Module;
+class ParamAttrsList;
 class TypeSymbolTable;
 class ValueSymbolTable;
 
@@ -43,6 +44,10 @@
   ValueMapType ValueMap;
   ValueList Values;
   
+  typedef DenseMap<const ParamAttrsList*, unsigned> ParamAttrMapType;
+  ParamAttrMapType ParamAttrMap;
+  std::vector<const ParamAttrsList*> ParamAttrs;
+  
   /// BasicBlocks - This contains all the basic blocks for the currently
   /// incorporated function.  Their reverse mapping is stored in ValueMap.
   std::vector<const BasicBlock*> BasicBlocks;
@@ -69,6 +74,13 @@
     assert(I != TypeMap.end() && "Type not in ValueEnumerator!");
     return I->second-1;
   }
+  
+  unsigned getParamAttrID(const ParamAttrsList *PAL) const {
+    if (PAL == 0) return 0;  // Null maps to zero.
+    ParamAttrMapType::const_iterator I = ParamAttrMap.find(PAL);
+    assert(I != ParamAttrMap.end() && "ParamAttr not in ValueEnumerator!");
+    return I->second;
+  }
 
   /// getFunctionConstantRange - Return the range of values that corresponds to
   /// function-local constants.
@@ -82,6 +94,9 @@
   const std::vector<const BasicBlock*> &getBasicBlocks() const {
     return BasicBlocks; 
   }
+  const std::vector<const ParamAttrsList*> getParamAttrs() const {
+    return ParamAttrs;
+  }
 
   /// PurgeAggregateValues - If there are any aggregate values at the end of the
   /// value list, remove them and return the count of the remaining values.  If
@@ -97,6 +112,7 @@
 private:
   void EnumerateValue(const Value *V);
   void EnumerateType(const Type *T);
+  void EnumerateParamAttrs(const ParamAttrsList *PAL);
   
   void EnumerateTypeSymbolTable(const TypeSymbolTable &ST);
   void EnumerateValueSymbolTable(const ValueSymbolTable &ST);