<div dir="ltr">I believe __device_builtin__ isn't even retained by the AST: <a href="https://godbolt.org/z/r7Kahd">https://godbolt.org/z/r7Kahd</a>. I also verified its absence using clang::Decl::attrs(). <br> <br>It's interesting to see that the AST (at least in clang-11) retains both "__device_builtin_surface_type__" and "__device_builtin_texture_type__" but just not "__device_builtin__" in clang/Sema/AttrParsedAttrKinds.inc.<br><br>-Oliver<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jul 29, 2020 at 10:08 PM Aaron Ballman <<a href="mailto:aaron@aaronballman.com">aaron@aaronballman.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Wed, Jul 29, 2020 at 8:47 AM Oliver Zhang via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I'd like to use the clang AST matcher to match the "__device_builtin__" attribute (ie, "__attribute__((device_builtin))") in pre-processed cuda code, but it seems that the matcher just ignores the attribute. (In clang/Sema/AttrParsedAttrKinds.inc, "AttributeCommonInfo::IgnoredAttribute" is returned upon __device_builtin__.)<br>
><br>
> Can anyone please provide any information on how to customize the matcher to match the ignored attribute?<br>
<br>
I suspect you cannot match against the ignored attribute because<br>
ignored attributes are not typically retained by the AST:<br>
<a href="https://godbolt.org/z/4v574o" rel="noreferrer" target="_blank">https://godbolt.org/z/4v574o</a><br>
<br>
Or are you finding that the AST has the attribute but it's not<br>
matching (perhaps because of handling  __device_builtin__ vs<br>
device_builtin differently in the AST matchers)?<br>
<br>
~Aaron<br>
<br>
><br>
> Thanks,<br>
> Oliver<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>