[PATCH] Refactor VariantMatcher::MatcherOps to reduce the amount of generated code.

Manuel Klimek klimek at google.com
Wed Sep 3 07:01:02 PDT 2014


... and I still think we should fix the compiler...

================
Comment at: lib/ASTMatchers/ASTMatchersInternal.cpp:29-37
@@ -28,1 +28,11 @@
 
+bool DynTypedMatcher::canConvertTo(ast_type_traits::ASTNodeKind To) const {
+  const auto SourceKind = getSupportedKind();
+  auto QualKind = ast_type_traits::ASTNodeKind::getFromNodeKind<QualType>();
+  auto TypeKind = ast_type_traits::ASTNodeKind::getFromNodeKind<Type>();
+  if (To.isSame(QualKind)) {
+    return SourceKind.isSame(TypeKind) || SourceKind.isSame(QualKind);
+  }
+  return SourceKind.isBaseOf(To);
+}
+
----------------
This needs a comment or two :)

http://reviews.llvm.org/D5124






More information about the cfe-commits mailing list