[PATCH] D30841: [clang-tidy] readability-misleading-indentation: fix chained if

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Sat Mar 11 03:04:28 PST 2017


xazax.hun added a comment.

Functionally LGTM!

Note that while the traversal of AST Matchers are not defined in general, in this particular case of chained ifs, it is guaranteed that parent nodes will be matched before the child nodes. For this reason I think it is ok to have a state like this. Maybe this worth a comment.

Performance wise maybe an llvm::DenseMap would perform better, according to the LLVM Programmer's Manual, it is a great data structure to map pointers to pointers.


https://reviews.llvm.org/D30841





More information about the cfe-commits mailing list