diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-01-29 01:43:29 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-01-29 01:43:29 +0000 |
commit | 8232ece5c1e57efe54342fb35610497d50bf894f (patch) | |
tree | 0b4d9d6fe602f90af2b756e15d2274ba7b89fb51 /lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | 8fbc0c296ef067150f3228e389ae04cf7b3b1992 (diff) |
Use an AttrBuilder to generate the correct AttributeSet.
We no longer accept an encoded integer as representing all of the
attributes. Convert this via the AttrBuilder class into an AttributeSet with the
correct representation (an AttributeSetImpl that holds a list of Attribute
objects).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173750 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Bitcode/Reader/BitcodeReader.cpp')
-rw-r--r-- | lib/Bitcode/Reader/BitcodeReader.cpp | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Bitcode/Reader/BitcodeReader.cpp b/lib/Bitcode/Reader/BitcodeReader.cpp index 2e1a5125fe..ca299c007c 100644 --- a/lib/Bitcode/Reader/BitcodeReader.cpp +++ b/lib/Bitcode/Reader/BitcodeReader.cpp @@ -464,15 +464,10 @@ bool BitcodeReader::ParseAttributeBlock() { return Error("Invalid ENTRY record"); for (unsigned i = 0, e = Record.size(); i != e; i += 2) { - Attribute ReconstitutedAttr = - AttributeFuncs::decodeLLVMAttributesForBitcode(Context, Record[i+1]); - Record[i+1] = ReconstitutedAttr.Raw(); - } - - for (unsigned i = 0, e = Record.size(); i != e; i += 2) { - AttrBuilder B(Record[i+1]); - if (B.hasAttributes()) - Attrs.push_back(AttributeSet::get(Context, Record[i], B)); + AttrBuilder B; + AttributeFuncs::decodeLLVMAttributesForBitcode(Context, B, + Record[i+1]); + Attrs.push_back(AttributeSet::get(Context, Record[i], B)); } MAttributes.push_back(AttributeSet::get(Context, Attrs)); |