[PATCH] D43392: [clang-tidy] Add Fuchsia checker for visibility attributes

Julie Hockett via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 26 12:37:35 PST 2018


juliehockett added inline comments.


================
Comment at: clang-tidy/fuchsia/AddVisibilityCheck.cpp:52-53
+  Finder->addMatcher(
+      functionDecl(allOf(hasAnyName(SmallVector<StringRef, 5>(Names.begin(),
+                                                              Names.end())),
+                         isDefinition(), unless(hasVisibilityAttr(V))))
----------------
aaron.ballman wrote:
> Can you use `makeArrayRef()` rather than using a `SmallVector` that allocates?
Type-wise it gets funky -- `makeArrayRef()` creates an `ArrayRef<std::string>`, and the matcher wants a container of `StringRefs`. Is there a good way to do that without allocating?


https://reviews.llvm.org/D43392





More information about the cfe-commits mailing list