MCPcopy Create free account
hub / github.com/GANGE666/xVMP / decodeLLVMAttributesForBitcode

Function decodeLLVMAttributesForBitcode

src/lib/Bitcode/Reader/BitcodeReader.cpp:1231–1245  ·  view source on GitHub ↗

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'.

Source from the content-addressed store, hash-verified

1229/// been decoded from the given integer. This function must stay in sync with
1230/// 'encodeLLVMAttributesForBitcode'.
1231static 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
1247Error BitcodeReader::parseAttributeBlock() {
1248 if (Stream.EnterSubBlock(bitc::PARAMATTR_BLOCK_ID))

Callers 1

parseAttributeBlockMethod · 0.85

Calls 3

isPowerOf2_32Function · 0.85
addRawAttributeValueFunction · 0.85
assertFunction · 0.50

Tested by

no test coverage detected