[cfe-dev] New matchers

Daniel Jasper djasper at google.com
Fri Sep 14 07:45:38 PDT 2012


+ cfe-dev

Sure. Feel free to add it. It seems to be just an oversight.

Cheers,
Daniel



On Fri, Sep 14, 2012 at 4:39 PM, Gábor Horváth <xazax.hun at gmail.com> wrote:

> Hi!
>
> I have my first question. We have several matchers about casts, however we
> don't jave matchers for C style casts.
> In my usercode I checked for C Style casts like this: expr(
> explicitCastExpr(unless(anyOf(constCastExpr(),reinterpretCastExpr(),
> dynamicCastExpr(),staticCastExpr())))))
>
> Do you think it is worth adding a matcher for c style casts to clang via
> VariadicDynCastAllOfMatcher? ( I guess it has the corresponding AST node
> type, although I did not check it yet. ) Even though one can check for c
> style casts like I did, but a similar matcher to other casts would be
> cleaner.
>
> Thanks,
> Gábor
>
> On 14 September 2012 13:24, Daniel Jasper <djasper at google.com> wrote:
>
>> Cool.
>>
>> To get started: To match throws declarations, you will need to create a:
>>
>> const internal::VariadicDynCastAllOfMatcher<
>>   Stmt,
>>   CXXThrowsExpr> throwsExpr;
>>
>> In include/clang/ASTMatchers/ASTMatchers.h.
>> And a comment and tests, if you want it to get into the upstream
>> repository ;-).
>>
>> When you write me an email, it might be a good idea to include
>> cfe-dev at cs.uiuc.edu. That way, people might reply quicker if I am not
>> available.
>>
>> Cheers,
>> Daniel
>>
>>
>> On Fri, Sep 14, 2012 at 1:15 PM, Gábor Horváth <xazax.hun at gmail.com>wrote:
>>
>>> Hi!
>>>
>>> I'm xazax from irc, thanks for assisting me. I'm planning to dig into
>>> the source code this weekend, if I have some questions I will drop you a
>>> mail, or contact you on irc.
>>>
>>> Thanks,
>>> Gábor Horváth
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120914/aec45b0a/attachment.html>


More information about the cfe-dev mailing list