unsigned LLVMGetAttributeCountAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx) {
auto *ASN = AttributeSetNode::get(unwrap<Function>(F)->getAttributes(), Idx);
+ if (!ASN)
+ return 0;
return ASN->getNumAttributes();
}
void LLVMGetAttributesAtIndex(LLVMValueRef F, LLVMAttributeIndex Idx,
LLVMAttributeRef *Attrs) {
auto *ASN = AttributeSetNode::get(unwrap<Function>(F)->getAttributes(), Idx);
+ if (!ASN)
+ return;
for (auto A: make_range(ASN->begin(), ASN->end()))
*Attrs++ = wrap(A);
}
LLVMAttributeIndex Idx) {
auto CS = CallSite(unwrap<Instruction>(C));
auto *ASN = AttributeSetNode::get(CS.getAttributes(), Idx);
+ if (!ASN)
+ return 0;
return ASN->getNumAttributes();
}
LLVMAttributeRef *Attrs) {
auto CS = CallSite(unwrap<Instruction>(C));
auto *ASN = AttributeSetNode::get(CS.getAttributes(), Idx);
+ if (!ASN)
+ return;
for (auto A: make_range(ASN->begin(), ASN->end()))
*Attrs++ = wrap(A);
}