<div dir="ltr">> You probably want to take a look at clang's PPCallbacks, they would allow you<br>> to be informed when such macro expansion happens.<div>Great, I will check PPCallbacks.</div><div><br></div><div>> This is the right place.<br>> I'm not sure a slack channel is more official place.<br>> There are also IRC channels (e.g. see #llvm).<br></div><div>Any additional resource is always welcome. Thank you</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 10, 2019 at 7:25 PM Roman Lebedev <<a href="mailto:lebedev.ri@gmail.com">lebedev.ri@gmail.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 Thu, Jan 10, 2019 at 10:07 AM FarSight Studios via cfe-dev<br>
<<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
><br>
> > M_E is a macro and that macro is expanded in your<br>
> ><br>
> > double varX = M_E;<br>
> ><br>
> > line. The expansion is not in math.h. The expansion is in the main file.<br>
> ><br>
> > <a href="http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/qRMj-W" rel="noreferrer" target="_blank">http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/qRMj-W</a><br>
><br>
> Thank you so much for the explanation<br>
You probably want to take a look at clang's PPCallbacks, they would allow you<br>
to be informed when such macro expansion happens.<br>
<br>
> > By the way, we have a llvm channel on the cpplang slack<br>
> > (<a href="https://cpplang.slack.com" rel="noreferrer" target="_blank">https://cpplang.slack.com</a>). That is a more suitable venue for your<br>
> > questions. This is the development mailing list.<br>
><br>
> I am sorry that I posted the questions in the wrong place. I didn't know that clang has a slack channel.<br>
This is the right place.<br>
I'm not sure a slack channel is more official place.<br>
There are also IRC channels (e.g. see #llvm).<br>
<br>
Roman.<br>
<br>
> On Thu, Jan 10, 2019 at 1:01 AM Stephen Kelly via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>> wrote:<br>
>><br>
>> On 09/01/2019 14:15, FarSight Studios via cfe-dev wrote:<br>
>> > Hi,<br>
>> ><br>
>> > Combining floatLiteral() Node Matcher with isExpansionInFileMatching()<br>
>> > Narrowing Matcher provides unexpected results.<br>
>> > The following matcher:<br>
>> > floatLiteral(isExpansionInFileMatching("include/math.h"))<br>
>> > does not matches "M_E" which is defined in "math.h"<br>
>> ><br>
>> > #include <math.h><br>
>> ><br>
>> > int consts(int n){<br>
>> > double varX = M_E;<br>
>> > return varX;<br>
>> > }<br>
>> ><br>
>> > It matches a single unrelated node:<br>
>> > FloatingLiteral 0x562c409bdaa8 </usr/include/math.h:1184:47> 'float'<br>
>> > 0.000000e+00<br>
>> ><br>
>> > Am I doing something wrong?<br>
>><br>
>><br>
>> M_E is a macro and that macro is expanded in your<br>
>><br>
>> double varX = M_E;<br>
>><br>
>> line. The expansion is not in math.h. The expansion is in the main file.<br>
>><br>
>> <a href="http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/qRMj-W" rel="noreferrer" target="_blank">http://ec2-18-191-7-3.us-east-2.compute.amazonaws.com:10240/z/qRMj-W</a><br>
>><br>
>> By the way, we have a llvm channel on the cpplang slack<br>
>> (<a href="https://cpplang.slack.com" rel="noreferrer" target="_blank">https://cpplang.slack.com</a>). That is a more suitable venue for your<br>
>> questions. This is the development mailing list.<br>
>><br>
>> Thanks,<br>
>><br>
>> Stephen.<br>
>><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="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
><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="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>