This fills an AttrBuilder object with the LLVM attributes that have been decoded from the given integer. This function must stay in sync with 'encodeLLVMAttributesForBitcode'.
| 1229 | /// been decoded from the given integer. This function must stay in sync with |
| 1230 | /// 'encodeLLVMAttributesForBitcode'. |
| 1231 | static void decodeLLVMAttributesForBitcode(AttrBuilder &B, |
| 1232 | uint64_t EncodedAttrs) { |
| 1233 | // FIXME: Remove in 4.0. |
| 1234 | |
| 1235 | // The alignment is stored as a 16-bit raw value from bits 31--16. We shift |
| 1236 | // the bits above 31 down by 11 bits. |
| 1237 | unsigned Alignment = (EncodedAttrs & (0xffffULL << 16)) >> 16; |
| 1238 | assert((!Alignment || isPowerOf2_32(Alignment)) && |
| 1239 | "Alignment must be a power of two."); |
| 1240 | |
| 1241 | if (Alignment) |
| 1242 | B.addAlignmentAttr(Alignment); |
| 1243 | addRawAttributeValue(B, ((EncodedAttrs & (0xfffffULL << 32)) >> 11) | |
| 1244 | (EncodedAttrs & 0xffff)); |
| 1245 | } |
| 1246 | |
| 1247 | Error BitcodeReader::parseAttributeBlock() { |
| 1248 | if (Stream.EnterSubBlock(bitc::PARAMATTR_BLOCK_ID)) |
no test coverage detected