aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Bitcode/Writer/ValueEnumerator.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-05-03 22:46:43 +0000
committerChris Lattner <sabre@nondot.org>2007-05-03 22:46:43 +0000
commit50954f5cba406a88011cc8ade3ceb4235830f907 (patch)
tree0b4584873e19e3c117a3427cc5c422f49cac7120 /lib/Bitcode/Writer/ValueEnumerator.h
parent76520191abf157dfa2bcb473406193ab362480b6 (diff)
downloadexternal_llvm-50954f5cba406a88011cc8ade3ceb4235830f907.zip
external_llvm-50954f5cba406a88011cc8ade3ceb4235830f907.tar.gz
external_llvm-50954f5cba406a88011cc8ade3ceb4235830f907.tar.bz2
enumerate parameter attr lists.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Writer/ValueEnumerator.h')
-rw-r--r--lib/Bitcode/Writer/ValueEnumerator.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/Bitcode/Writer/ValueEnumerator.h b/lib/Bitcode/Writer/ValueEnumerator.h
index 77f27da..d78fdb8 100644
--- a/lib/Bitcode/Writer/ValueEnumerator.h
+++ b/lib/Bitcode/Writer/ValueEnumerator.h
@@ -24,6 +24,7 @@ class Value;
class BasicBlock;
class Function;
class Module;
+class ParamAttrsList;
class TypeSymbolTable;
class ValueSymbolTable;
@@ -43,6 +44,10 @@ private:
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 @@ public:
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 @@ public:
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 @@ public:
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);