[PATCH] D87600: [SyntaxTree][List] `assertInvariants` for `List`s
Dmitri Gribenko via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Sep 14 01:53:26 PDT 2020
gribozavr2 accepted this revision.
gribozavr2 added inline comments.
This revision is now accepted and ready to land.
================
Comment at: clang/lib/Tooling/Syntax/Tree.cpp:236
+
+ auto *L = dyn_cast<List>(T);
+ if (!L)
----------------
================
Comment at: clang/lib/Tooling/Syntax/Tree.cpp:241
+ assert(C->getRole() == NodeRole::ListElement ||
+ C->getRole() == NodeRole::ListDelimiter);
+ if (C->getRole() == NodeRole::ListDelimiter) {
----------------
This assertion is true only for trees that represent correct code. To cover all cases, add the unknown role.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D87600/new/
https://reviews.llvm.org/D87600
More information about the cfe-commits
mailing list