This is an archive of the discontinued LLVM Phabricator instance.

Reorder ASTNodeKind::AllKindInfo to match NodeKindId.
ClosedPublic

Authored by alexfh on Apr 13 2016, 8:12 AM.

Details

Summary

AllKindInfo is being indexed by NodeKindId, so the order must match.
I've updated the tests, though I'm not sure what exactly they verify and whether
the new state of the tests makes sense ;)

I can add dedicated tests for this change, if needed.

Diff Detail

Repository
rL LLVM

Event Timeline

alexfh updated this revision to Diff 53562.Apr 13 2016, 8:12 AM
alexfh retitled this revision from to Reorder ASTNodeKind::AllKindInfo to match NodeKindId..
alexfh updated this object.
alexfh added a reviewer: sbenza.
alexfh added a subscriber: cfe-commits.
alexfh updated this revision to Diff 53566.Apr 13 2016, 8:19 AM
  • Added a test
sbenza edited edge metadata.Apr 13 2016, 8:27 AM

Those tests are testing the code completion you get in clang-query.
The type list must match what that matcher supports.

hasParent is declared as

const internal::ArgumentAdaptingMatcherFunc<
    internal::HasParentMatcher,
    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>,
    internal::TypeList<Decl, NestedNameSpecifierLoc, Stmt, TypeLoc>>
    LLVM_ATTRIBUTE_UNUSED hasParent = {};

so the completion message is correct now.

unittests/AST/ASTTypeTraitsTest.cpp
118 ↗(On Diff #53566)

Add a derived Decl type too.
You added one for Stmt and Type, but not for Decl.

alexfh updated this revision to Diff 53569.Apr 13 2016, 8:34 AM
alexfh edited edge metadata.

Added a Decl descendant for a test.

alexfh marked an inline comment as done.Apr 13 2016, 8:34 AM
sbenza accepted this revision.Apr 13 2016, 8:45 AM
sbenza edited edge metadata.
This revision is now accepted and ready to land.Apr 13 2016, 8:45 AM
This revision was automatically updated to reflect the committed changes.
Prazek added a subscriber: Prazek.Apr 14 2016, 2:06 AM

Does it solve my problem with isInTemplateInstantiation? :)

alexfh added a subscriber: alexfh.Apr 14 2016, 2:32 AM

No, but I'm working on the solution.