Adds support for using the ofKind in clang-query and other dynamic matcher use cases
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
140 ms | lldb-unit.Host/_/HostTests::Unknown Unit Message ("") |
Event Timeline
Thank you for this! It basically LG, but can you also add a dynamic matcher unit test for this functionality?
clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | ||
---|---|---|
102–106 | Did clang-format produce this formatting? | |
107 | Elide braces | |
clang/lib/ASTMatchers/Dynamic/Marshallers.h | ||
222 | Typetraits - > Type traits |
Added test cases and address nits
clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | ||
---|---|---|
102–106 | when I ran git-clang-format I dont think it did, but when i went to upload the patch i got this in the pre-upload linting --- /home/nathan/src/llvm-project/clang/lib/ASTMatchers/Dynamic/Marshallers.cpp 2020-04-09 12:12:28.810339833 +0100 +++ /tmp/6p7zxlltj4g8wgcc/9888-onMes8 2020-04-09 12:44:11.187257096 +0100 @@ -99,11 +99,11 @@ llvm::Optional<std::string> clang::ast_matchers::dynamic::internal::ArgTypeTraits< clang::UnaryExprOrTypeTrait>::getBestGuess(const VariantValue &Value) { - static constexpr llvm::StringRef Allowed[] = {"UETT_SizeOf", - "UETT_AlignOf", - "UETT_VecStep", - "UETT_OpenMPRequiredSimdAlign", - "UETT_PreferredAlignOf",}; + static constexpr llvm::StringRef Allowed[] = { + "UETT_SizeOf", "UETT_AlignOf", + "UETT_VecStep", "UETT_OpenMPRequiredSimdAlign", + "UETT_PreferredAlignOf", + }; |
LGTM, thank you!
clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | ||
---|---|---|
102–106 | I think the pre-upload linting is wrong (I can't find many instances of lists that look like that in LLVM anyway, but I know of plenty of instances of the other style). Not a huge deal though. |
clang/lib/ASTMatchers/Dynamic/Marshallers.cpp | ||
---|---|---|
102–106 | I tried to manually invoke clang-format on it (using trunk) and it suggested the same format |
Typetraits - > Type traits
Also, missing a full stop at the end of the comment.