[PATCH] Adds the equalsBoundNode matcher.
Manuel Klimek
klimek at google.com
Thu Jun 20 06:17:25 PDT 2013
================
Comment at: include/clang/AST/ASTTypeTraits.h:183
@@ +182,3 @@
+ return *get<QualType>() == *Other.get<QualType>();
+ } else {
+ assert(getMemoizationData() && Other.getMemoizationData());
----------------
Alexander Kornienko wrote:
> Nit: it would be cleaner if you removed 'else'.
Done.
================
Comment at: include/clang/ASTMatchers/ASTMatchers.h:2298
@@ +2297,3 @@
+ TOOLING_COMPILE_ASSERT(
+ (llvm::is_base_of<Stmt, NodeType>::value) ||
+ (llvm::is_base_of<Decl, NodeType>::value) ||
----------------
Alexander Kornienko wrote:
> Is wrapping this in parens a way to shut up some diagnostic?
Yes. This is a macro, which otherwise takes the "," as the start of a new parameter.
================
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:147
@@ +146,3 @@
+ bool removeBindings(const ExcludePredicate &Predicate) {
+ Bindings.resize(std::distance(
+ Bindings.begin(),
----------------
Alexander Kornienko wrote:
> Actually, I meant erase, not resize: http://en.wikipedia.org/wiki/Erase-remove_idiom ;)
>
> Bindings.erase(std::remove_if(Bindings.begin(), Bindings.end(), Predicate), Bindings.end());
Done.
http://llvm-reviews.chandlerc.com/D1009
More information about the cfe-commits
mailing list