Use the semantic spelling (an enum) rather than a string, to determine what access qualifier is used.
Since we're updating this, can you change attrs to Attrs, and maybe make it a const AttributeList *?
The caller can no longer tell the difference between a real-only OpenCL access attribute and no OpenCL access attribute. I know that this was the effective behavior of the original code, but that's specific to the current use case, so I think this change is a tiny regression in the semantics.
Just checking, but, has this situation already been diagnosed elsewhere?