[cfe-dev] Adding a new def for global keyword in Attr.td

Aaron W.Hsu arcfide at sacrideo.us
Wed Oct 29 14:00:01 PDT 2014


Hello Clang Developers:


I’m new to clang and I’m trying to add a “global” keyword to a new extension of C. I’ve found Attr.td and I’ve been playing with it. It seems that what I want is basically the same as what is in the OpenCLGlobalAddressSpace definition:



def OpenCLGlobalAddressSpace : TypeAttr {

let Spellings = [Keyword<"__global">, Keyword<"global">];

let Documentation = [Undocumented];

}
However, as you can see, OpenCL already uses “global” and the like. I had thought that just putting the TokenKinds.def options in to ensure that it only was recognized for the new language would work, but it turns out that even then, I still get an assertion error about multiple string matches if I duplicate the above using PXCGlobalAddressSpace instead. What I really want is to have the “global” keyword, when in my PXC language, to be mapped as a PXCGlobalAddressSpace, and not as an OpenCLGlobalAddressSpace. How can I do this? Attr.td does not seem to support multiple definitions with the same keywords.





-- 
Aaron W. Hsu | arcfide at sacrideo.us | http://www.sacrideo.us
Please support my work: https://www.gratipay.com/arcfide/
לֵ֤ב חֲכָמִים֙ בְּבֵ֣ית אֵ֔בֶל וְלֵ֥ב כְּסִילִ֖ים בְּבֵ֥ית שִׂמְחָֽה׃
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20141029/75b85414/attachment.html>


More information about the cfe-dev mailing list