[PATCH] Adds the equalsBoundNode matcher.

Alexander Kornienko alexfh at google.com
Thu Jun 20 04:44:51 PDT 2013



================
Comment at: include/clang/AST/ASTTypeTraits.h:183
@@ +182,3 @@
+      return *get<QualType>() == *Other.get<QualType>();
+    } else {
+      assert(getMemoizationData() && Other.getMemoizationData());
----------------
Nit: it would be cleaner if you removed 'else'.

================
Comment at: include/clang/ASTMatchers/ASTMatchersInternal.h:147
@@ +146,3 @@
+  bool removeBindings(const ExcludePredicate &Predicate) {
+    Bindings.resize(std::distance(
+        Bindings.begin(),
----------------
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());

================
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) ||
----------------
Is wrapping this in parens a way to shut up some diagnostic?


http://llvm-reviews.chandlerc.com/D1009



More information about the cfe-commits mailing list