How does one access memory attributes in llvm-c-16?

Previously readnone, readonly, etc were enum attributes that could be added via LLVMAddAttributeAtIndex. How does this work in LLVM-16?

I’ve finally gotten back to this and figured it out. LLVMCreateEnumAttribute can be used with the KindID for memory and a Val set with the bits to specifiy the memory attributes. I think the bits work as follows:

0 = argmem read
1 = argmem write
2 = inaccessiblemem read
3 = inaccessiblemem write
4 = memory read
5 = memory write