Details
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 13954 Build 13954: arc lint + arc unit
Event Timeline
Don't forget that you also need to regenerate the HTML docs:
$ cd docs/tools # yes, cd $ ./dump_ast_matchers.py
The documentation needs to be regenerated for this patch. One thing that seems to be inconsistent is with the "what gets matched" messages is that sometimes it includes extra adornments like curly braces and other times it does not. It might be good to pick a style and try to be more consistent with it.
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
1792 | I don't think this adds clarity. | |
1841 | I don't think this adds clarity. | |
1851 | I think this adds confusion. |
Do I need to do anything to re-generate the doc and check it into this revision? If so, can you show me the Doxygen generation instruction?
Reverted some changes as they may cause confusion which are pointed by you.
Yes, the documentation for this is something that has to be generated manually. You should just have to execute clang/docs/tools/dump_ast_matchers.py to regenerate the documentation.
Reverted some changes as they may cause confusion which are pointed by you.
Thanks! I found one more minor nit with some example code, but this basically looks good aside from the documentation bit.
include/clang/ASTMatchers/ASTMatchers.h | ||
---|---|---|
803 | Spurious semi-colon in the declaration. |
I am also not sure about this function: line 3548
/// \brief Matches \c FunctionDecls and \c FunctionProtoTypes that have a /// specific parameter count. /// /// Given /// \code /// void f(int i) {} /// void g(int i, int j) {} /// void h(int i, int j); /// void j(int i); /// void k(int x, int y, int z, ...); /// \endcode /// functionDecl(parameterCountIs(2)) /// matches void g(int i, int j) {} /// functionProtoType(parameterCountIs(2)) /// matches void h(int i, int j) /// functionProtoType(parameterCountIs(3)) /// matches void k(int x, int y, int z, ...); AST_POLYMORPHIC_MATCHER_P(parameterCountIs, AST_POLYMORPHIC_SUPPORTED_TYPES(FunctionDecl, FunctionProtoType), }
Both functionDecl and functionProtoType match these functions as long as the parameter count is matched.
% echo 'match functionDecl()'|clang-query =(printf 'void f(){}') -- -xc++ % echo 'match functionProtoType()'|clang-query =(printf 'void f(){}') -- -xc++
I'm not certain I'm following along. The quoted matcher is for parameterCountIs(), but the test code you've posted doesn't use that matcher. However, the quoted comment seems like it's wrong: functionDecl(parameterCountIs(2)) should match both g() and h(), not just g(), I believe.
Yes, I was asking about this because the results seemed to be wrong. I should have used parameterCountIs() to reduce the confusion :) I'll leave them untouched.
Alternatively, you can try out those declarations and the given matchers in clang-query to see if the results match what's listed, and update the comments based on what you find. Either way is fine.
Great, all that remains is for you to regenerate the documentation file and upload that with the next patch.
Spurious semi-colon in the declaration.