[PATCH] D77791: [ASTMatchers] Add support for dynamic matching of ofKind narrowing matcher
Aaron Ballman via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 9 05:23:24 PDT 2020
aaron.ballman added a comment.
Thank you for this! It basically LG, but can you also add a dynamic matcher unit test for this functionality?
================
Comment at: clang/lib/ASTMatchers/Dynamic/Marshallers.cpp:102-106
+ static constexpr llvm::StringRef Allowed[] = {
+ "UETT_SizeOf", "UETT_AlignOf",
+ "UETT_VecStep", "UETT_OpenMPRequiredSimdAlign",
+ "UETT_PreferredAlignOf",
+ };
----------------
Did clang-format produce this formatting?
================
Comment at: clang/lib/ASTMatchers/Dynamic/Marshallers.cpp:107
+ };
+ if (Value.isString()) {
+ return ::getBestGuess(Value.getString(), llvm::makeArrayRef(Allowed),
----------------
Elide braces
================
Comment at: clang/lib/ASTMatchers/Dynamic/Marshallers.h:222
+ getUnaryOrTypeTraitKind(llvm::StringRef ClauseKind) {
+ // FIXME: Typetraits should probably be in a `.def` to make less error prone
+ return llvm::StringSwitch<Optional<UnaryExprOrTypeTrait>>(ClauseKind)
----------------
Typetraits - > Type traits
Also, missing a full stop at the end of the comment.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D77791/new/
https://reviews.llvm.org/D77791
More information about the cfe-commits
mailing list