[PATCH] D77791: [ASTMatchers] Add support for dynamic matching of ofKind narrowing matcher

Nathan James via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Apr 9 07:01:41 PDT 2020


njames93 marked an inline comment as done.
njames93 added inline comments.


================
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",
+  };
----------------
aaron.ballman wrote:
> njames93 wrote:
> > aaron.ballman wrote:
> > > Did clang-format produce this formatting?
> > 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",
> > +  };
> > ```
> 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.
I tried to manually invoke clang-format on it (using trunk) and it suggested the same format


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