aaron.ballman closed this revision.
aaron.ballman marked an inline comment as done.
aaron.ballman added a comment.
Thanks for the review and suggestions! I've commit in r261008.
http://reviews.llvm.org/D17034
___
cfe-commits mailing list
cfe-commits
aaron.ballman marked 2 inline comments as done.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ integerLiteral(equals(0), hasParent(expr(hasType(pointerType());
+}
Ah, good catch! No,
aaron.ballman updated this revision to Diff 48092.
aaron.ballman marked an inline comment as done.
aaron.ballman added a comment.
Removed an unnecessary expr() matcher.
http://reviews.llvm.org/D17034
Files:
docs/LibASTMatchersReference.html
include/clang/ASTMatchers/ASTMatchers.h
lib/ASTM
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
aaron.ballman wrote:
> sbenza
aaron.ballman marked an inline comment as done.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
sbenza wrote
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4838
@@ +4837,3 @@
+ gnuNullExpr(), cxxNullPtrLiteralExpr(),
+ expr(integerLiteral(equals(0),
hasParent(expr(hasType(pointerType()));
+}
is this expr() necessary?
ht
aaron.ballman updated this revision to Diff 48075.
aaron.ballman added a comment.
Using the AST_MATCHER_FUNCTION macro instead.
Using Expr::isNullPointerConstant() turns out to have strange behavior with
implicit casts and nullptr, and also requires further restrictions (for
instance, it claims
aaron.ballman added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
sbenza wrote:
> aaron.ballman wrote:
> > aaron.ballman wrote:
> > > s
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
aaron.ballman wrote:
> aaron.ballman wrote:
> > sbenza wrote:
> > > sbenza w
aaron.ballman added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
sbenza wrote:
> sbenza wrote:
> > Use AST_MATCHER_FUNCTION instead, w
sbenza added inline comments.
Comment at: include/clang/ASTMatchers/ASTMatchers.h:4821
@@ +4820,3 @@
+/// initializer for i.
+AST_MATCHER(Expr, nullPointerConstant) {
+ return Matcher(
Use AST_MATCHER_FUNCTION instead, where the return value is the matcher
(in
aaron.ballman created this revision.
aaron.ballman added reviewers: klimek, sbenza.
aaron.ballman added a subscriber: cfe-commits.
Herald added a subscriber: klimek.
There are several ways to specify a null pointer constant. C++11 has nullptr,
GNU has the __null extension, and there's always NULL
12 matches
Mail list logo