diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-04-22 05:46:44 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-04-22 05:46:44 +0000 |
commit | 4388f0b4faf6fbac0e59334653cf60da8a869755 (patch) | |
tree | 2da9af184c7410f63c0e54b6d281a1bf40a3a4d4 /llvm/lib/Bytecode | |
parent | d1c1ed1cb972ab1a6638fb2dfdd2c7b6b47507c0 (diff) | |
download | bcm5719-llvm-4388f0b4faf6fbac0e59334653cf60da8a869755.tar.gz bcm5719-llvm-4388f0b4faf6fbac0e59334653cf60da8a869755.zip |
For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.
llvm-svn: 36327
Diffstat (limited to 'llvm/lib/Bytecode')
-rw-r--r-- | llvm/lib/Bytecode/Reader/Reader.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Bytecode/Reader/Reader.cpp b/llvm/lib/Bytecode/Reader/Reader.cpp index 49792693dcc..4cb67c31565 100644 --- a/llvm/lib/Bytecode/Reader/Reader.cpp +++ b/llvm/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; } |