| 1205 | } |
| 1206 | |
| 1207 | static void addRawAttributeValue(AttrBuilder &B, uint64_t Val) { |
| 1208 | if (!Val) return; |
| 1209 | |
| 1210 | for (Attribute::AttrKind I = Attribute::None; I != Attribute::EndAttrKinds; |
| 1211 | I = Attribute::AttrKind(I + 1)) { |
| 1212 | if (I == Attribute::Dereferenceable || |
| 1213 | I == Attribute::DereferenceableOrNull || |
| 1214 | I == Attribute::ArgMemOnly || |
| 1215 | I == Attribute::AllocSize) |
| 1216 | continue; |
| 1217 | if (uint64_t A = (Val & getRawAttributeMask(I))) { |
| 1218 | if (I == Attribute::Alignment) |
| 1219 | B.addAlignmentAttr(1ULL << ((A >> 16) - 1)); |
| 1220 | else if (I == Attribute::StackAlignment) |
| 1221 | B.addStackAlignmentAttr(1ULL << ((A >> 26)-1)); |
| 1222 | else |
| 1223 | B.addAttribute(I); |
| 1224 | } |
| 1225 | } |
| 1226 | } |
| 1227 | |
| 1228 | /// This fills an AttrBuilder object with the LLVM attributes that have |
| 1229 | /// been decoded from the given integer. This function must stay in sync with |
no test coverage detected