[PATCH] D124827: [pseudo] Simplify the forest dump, NFC.
Haojian Wu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue May 3 05:15:16 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rGb18abde8ada1: [pseudo] Simplify the forest dump, NFC. (authored by hokein).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D124827/new/
https://reviews.llvm.org/D124827
Files:
clang-tools-extra/pseudo/lib/Forest.cpp
Index: clang-tools-extra/pseudo/lib/Forest.cpp
===================================================================
--- clang-tools-extra/pseudo/lib/Forest.cpp
+++ clang-tools-extra/pseudo/lib/Forest.cpp
@@ -74,16 +74,13 @@
} else if (P->kind() == Sequence) {
Children = P->elements();
if (Abbreviated) {
- if (P->startTokenIndex() == End)
- return;
- for (size_t I = 0; I < Children.size(); ++I)
- if (Children[I]->startTokenIndex() == P->startTokenIndex() &&
- EndOfElement(I) == End) {
- return Dump(
- Children[I], End,
- /*ElidedParent=*/ElidedParent.getValueOr(P->symbol()),
- LineDec);
- }
+ if (Children.size() == 1) {
+ assert(Children[0]->startTokenIndex() == P->startTokenIndex() &&
+ EndOfElement(0) == End);
+ return Dump(Children[0], End,
+ /*ElidedParent=*/ElidedParent.getValueOr(P->symbol()),
+ LineDec);
+ }
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D124827.426658.patch
Type: text/x-patch
Size: 1150 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220503/7840e88e/attachment.bin>
More information about the cfe-commits
mailing list