summaryrefslogtreecommitdiff
path: root/lib/Bytecode
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-04-22 05:46:44 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-04-22 05:46:44 +0000
commit4f859aa532dbf061736f9c23e0d0882b5cdfe566 (patch)
tree5b03ace46223602b455c373f25432ef52f8ea2b4 /lib/Bytecode
parent3b87d6a7b57277a17e75ec83759ea95e0579e219 (diff)
downloadllvm-4f859aa532dbf061736f9c23e0d0882b5cdfe566.tar.gz
llvm-4f859aa532dbf061736f9c23e0d0882b5cdfe566.tar.bz2
llvm-4f859aa532dbf061736f9c23e0d0882b5cdfe566.tar.xz
For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or destroy them but instead must go through the ParamAttrsList::get() interface. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bytecode')
-rw-r--r--lib/Bytecode/Reader/Reader.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Bytecode/Reader/Reader.cpp b/lib/Bytecode/Reader/Reader.cpp
index 49792693dc..4cb67c3156 100644
--- a/lib/Bytecode/Reader/Reader.cpp
+++ b/lib/Bytecode/Reader/Reader.cpp
@@ -1078,16 +1078,18 @@ const Type *BytecodeReader::ParseType() {
ParamAttrsList *BytecodeReader::ParseParamAttrsList() {
unsigned NumAttrs = read_vbr_uint();
- ParamAttrsList *Attrs = 0;
+ ParamAttrsList *PAL = 0;
if (NumAttrs) {
- Attrs = new ParamAttrsList();
+ ParamAttrsVector Attrs;
+ ParamAttrsWithIndex PAWI;
while (NumAttrs--) {
- uint16_t index = read_vbr_uint();
- uint16_t attrs = read_vbr_uint();
- Attrs->addAttributes(index, attrs);
+ PAWI.index = read_vbr_uint();
+ PAWI.attrs = read_vbr_uint();
+ Attrs.push_back(PAWI);
}
+ PAL = ParamAttrsList::get(Attrs);
}
- return Attrs;
+ return PAL;
}