aaron.ballman accepted this revision.
aaron.ballman added a comment.
This revision is now accepted and ready to land.
LGTM, thank you for this!
http://reviews.llvm.org/D19876
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.
etienneb updated this revision to Diff 56942.
etienneb added a comment.
re-generating doc
http://reviews.llvm.org/D19876
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
include/clang/ASTMatchers/ASTMatchersInternal.h
unittests/ASTMatchers/ASTMatchersTest
aaron.ballman added a comment.
In http://reviews.llvm.org/D19876#423582, @etienneb wrote:
> Aaron? minus re-generation of the doc.
> Is that what you want to see?
Yes, this is the direction I was hoping for, thank you!
> note: returned types for both getLength are not the same (APInt vs unsig
etienneb added a comment.
Aaron? minus re-generation of the doc.
Is that what you want to see?
note: returned types for both getLength are not the same (APInt vs unsigned
int).
I took the 'hasSize'-Matcher approach to let overloaded operators do the job
for dispatching types.
note: there is a
etienneb updated this revision to Diff 56425.
etienneb added a comment.
fix unittests
http://reviews.llvm.org/D19876
Files:
include/clang/ASTMatchers/ASTMatchers.h
include/clang/ASTMatchers/ASTMatchersInternal.h
unittests/ASTMatchers/ASTMatchersTest.cpp
Index: unittests/ASTMatchers/ASTMa
etienneb updated this revision to Diff 56423.
etienneb added a comment.
merging hasSize
http://reviews.llvm.org/D19876
Files:
include/clang/ASTMatchers/ASTMatchers.h
include/clang/ASTMatchers/ASTMatchersInternal.h
unittests/ASTMatchers/ASTMatchersTest.cpp
Index: unittests/ASTMatchers/AST
etienneb added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:1578
@@ +1577,3 @@
+/// \endcode
+AST_MATCHER_P(StringLiteral, lengthIs, unsigned, N) {
+ return Node.getLength() == N;
etienneb wrote:
> aaron.ballman wrote:
> > etienneb wrote:
etienneb added a comment.
Other opinions?
I'll proceed to the cleanup if no one else has comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:1575
@@ +1574,3 @@
+/// \code
+/// char *s = "abcd"; wchar_t *ws = L"abcd";
+/// char *t = "a";
aaron.ballm
aaron.ballman added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:1575
@@ +1574,3 @@
+/// \code
+/// char *s = "abcd"; wchar_t *ws = L"abcd";
+/// char *t = "a";
etienneb wrote:
> aaron.ballman wrote:
> > Split these onto two lines?
> If
etienneb added a comment.
Aaron? could you comment on it?
Comment at: include/clang/ASTMatchers/ASTMatchers.h:1575
@@ +1574,3 @@
+/// \code
+/// char *s = "abcd"; wchar_t *ws = L"abcd";
+/// char *t = "a";
aaron.ballman wrote:
> Split these onto two lines?
I
etienneb added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:1578
@@ +1577,3 @@
+/// \endcode
+AST_MATCHER_P(StringLiteral, lengthIs, unsigned, N) {
+ return Node.getLength() == N;
aaron.ballman wrote:
> Perhaps we can adjust the `hasSize()
aaron.ballman added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:1575
@@ +1574,3 @@
+/// \code
+/// char *s = "abcd"; wchar_t *ws = L"abcd";
+/// char *t = "a";
Split these onto two lines?
Comment at: include/clang/AST
etienneb updated this revision to Diff 56025.
etienneb added a comment.
fix doc
http://reviews.llvm.org/D19876
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTMatchers/Dynamic/Registry.cpp
unittests/ASTMatchers/ASTMatchersTest.cpp
Index: unittest
etienneb created this revision.
etienneb added reviewers: alexfh, sbenza, aaron.ballman, klimek.
etienneb added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
This patch is adding support for a matcher to check string literal length.
This matcher is used in clang-tidy checkers and
14 matches
Mail list logo