This returns a list of valid (and useful) completions for a context (a list
of outer matchers), ordered by decreasing relevance then alphabetically. It
will be used by the matcher parser to implement completion.
Details
- Reviewers
klimek sbenza - Commits
- rL199950: Introduce Registry::getCompletions.
Diff Detail
Event Timeline
| include/clang/AST/ASTTypeTraits.h | ||
|---|---|---|
| 67 ↗ | (On Diff #5622) | Comment what is the meaning of A<B. It can't be used as a meaningful comparison between the types. |
| include/clang/ASTMatchers/Dynamic/Registry.h | ||
| 38 ↗ | (On Diff #5622) | StringRef |
| lib/ASTMatchers/Dynamic/Marshallers.h | ||
| 207 ↗ | (On Diff #5622) | 100? |
| 258 ↗ | (On Diff #5622) | Comment these. |
| 363 ↗ | (On Diff #5622) | This is repeated with FixedArgCountMatcherDesc. Factor this out into a function. |
| 382 ↗ | (On Diff #5622) | You could make this field also const if BuildReturnTypeVector<> returned the vector instead of taking by ref. |
| 541 ↗ | (On Diff #5622) | Please add a check that all the overloads have the same properties. |
| 549 ↗ | (On Diff #5622) | This has the potential to give invalid autocomplete. |
| 605 ↗ | (On Diff #5622) | You are not using LLVM_OVERRIDE consistently. |
| 663 ↗ | (On Diff #5622) | Is the overload above used if you add this one? |
- Address reviewer comments
| include/clang/AST/ASTTypeTraits.h | ||
|---|---|---|
| 67 ↗ | (On Diff #5622) | Done. |
| include/clang/ASTMatchers/Dynamic/Registry.h | ||
| 38 ↗ | (On Diff #5622) | Done. |
| lib/ASTMatchers/Dynamic/Marshallers.h | ||
| 207 ↗ | (On Diff #5622) | Arbitrary. I think that if we have an inheritance hierarchy 100 levels deep we probably have bigger problems than this constant :) |
| 258 ↗ | (On Diff #5622) | I think the function names are self explanatory. |
| 363 ↗ | (On Diff #5622) | Done. |
| 382 ↗ | (On Diff #5622) | Probably, but I don't think it matters too much whether this is const or not. All the member functions are const qualified anyway. |
| 541 ↗ | (On Diff #5622) | Done. |
| 549 ↗ | (On Diff #5622) | Done. (This also applies to other matcher descriptors so I added the note to the base class.) This will probably have to be done by passing more context information through to getArgKinds. |
| 605 ↗ | (On Diff #5622) | I'm using it consistently wherever I intend to override a non-pure virtual function. |
| 663 ↗ | (On Diff #5622) | No. We check on lines 409 and 410 of RegistryTest.cpp that the correct overload is chosen for dyncast matchers. |
| lib/ASTMatchers/Dynamic/Marshallers.h | ||
|---|---|---|
| 605 ↗ | (On Diff #5622) | I see. Shouldn't it be used for overriding any virtual method, even if it is pure? |
| 663 ↗ | (On Diff #5622) | What I mean is that if the overload above is not really used, we should get rid of it, and merge VariadicFuncMatcherDesc with DynCastAllOfMatcherDesc. |