aaron.ballman added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)),
+ callee(namedDecl(hasName("data"
+ .bind("call",
shuaiwang added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)),
+ callee(namedDecl(hasName("data"
+ .bind("call",
aaron.ballman added a comment.
In https://reviews.llvm.org/D45702#1086802, @shuaiwang wrote:
> In https://reviews.llvm.org/D45702#1086250, @aaron.ballman wrote:
>
> > In https://reviews.llvm.org/D45702#1085890, @shuaiwang wrote:
> >
> > > In https://reviews.llvm.org/D45702#1085224,
shuaiwang added a comment.
In https://reviews.llvm.org/D45702#1086250, @aaron.ballman wrote:
> In https://reviews.llvm.org/D45702#1085890, @shuaiwang wrote:
>
> > In https://reviews.llvm.org/D45702#1085224, @aaron.ballman wrote:
> >
> > > > Have you run this over any large code bases to see
aaron.ballman added a comment.
In https://reviews.llvm.org/D45702#1085890, @shuaiwang wrote:
> In https://reviews.llvm.org/D45702#1085224, @aaron.ballman wrote:
>
> > > Have you run this over any large code bases to see whether the check
> > > triggers in practice?
> >
> > I'm still curious
shuaiwang added a comment.
In https://reviews.llvm.org/D45702#1085224, @aaron.ballman wrote:
> > Have you run this over any large code bases to see whether the check
> > triggers in practice?
>
> I'm still curious about this, btw.
Yes it triggers in Google's code base.
Repository:
rCTE
shuaiwang added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)),
+ callee(namedDecl(hasName("data"
+ .bind("call",
aaron.ballman added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:31
+void RedundantDataCallCheck::registerMatchers(MatchFinder *Finder) {
+ using namespace ast_matchers;
+
No need to register any of these matchers unless in C++
Eugene.Zelenko added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher, pointerType(pointee(TypesMatcher)),
+ callee(namedDecl(hasName("data"
+ .bind("call",
aaron.ballman added a comment.
> Have you run this over any large code bases to see whether the check triggers
> in practice?
I'm still curious about this, btw.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:45
+ anyOf(TypesMatcher,
Eugene.Zelenko added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:22
+
+const char kDefaultTypes[] =
+"::std::basic_string;::std::basic_string_view;::std::vector;::std::array";
shuaiwang wrote:
> Eugene.Zelenko wrote:
> >
shuaiwang added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:22
+
+const char kDefaultTypes[] =
+"::std::basic_string;::std::basic_string_view;::std::vector;::std::array";
Eugene.Zelenko wrote:
> Actually you should use
shuaiwang updated this revision to Diff 143207.
shuaiwang marked 7 inline comments as done.
shuaiwang added a comment.
Addressed more comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
Eugene.Zelenko added inline comments.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:22
+
+const char kDefaultTypes[] =
+"::std::basic_string;::std::basic_string_view;::std::vector;::std::array";
Actually you should use static, not anonymous
shuaiwang updated this revision to Diff 143204.
shuaiwang marked 7 inline comments as done.
shuaiwang added a comment.
Addressed review comments.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
aaron.ballman added a comment.
Have you run this over any large code bases to see whether the check triggers
in practice?
Comment at: docs/clang-tidy/checks/list.rst:95
fuchsia-default-arguments
+ fuchsia-header-anon-namespaces (redirects to google-build-namespaces)
Eugene.Zelenko added inline comments.
Comment at: docs/ReleaseNotes.rst:63
+
+ This check suggests removing redundant `.data()` calls.
+
Eugene.Zelenko wrote:
> I would suggest //Finds redundant `.data()` calls.// Same in documentation.
>
> Please also move to
Eugene.Zelenko added a comment.
Please also take a look on 26817 for another idea for //.data()//.
Comment at: clang-tidy/readability/RedundantDataCallCheck.cpp:20
+namespace readability {
+namespace {
+const char kDefaultTypes[] =
Please separate with empty
shuaiwang created this revision.
Herald added subscribers: cfe-commits, xazax.hun, mgorny, klimek.
shuaiwang added a reviewer: sbenza.
Repository:
rCTE Clang Tools Extra
https://reviews.llvm.org/D45702
Files:
clang-tidy/readability/CMakeLists.txt
19 matches
Mail list logo