Add a 'StringRef' version of hasAttribute.