[cfe-commits] [PATCH] Modifying BoundNodes to store bindings as void* pointers and use getNodeAs instead of getDeclAs and getStmtAs.

Manuel Klimek reviews at llvm-reviews.chandlerc.com
Thu Aug 23 22:32:46 PDT 2012



================
Comment at: google3/third_party/llvm/llvm/tools/clang/lib/ASTMatchers/ASTMatchersInternal.cpp:21-25
@@ -20,1 +20,7 @@
 
+BoundNodesMap::BoundNodesMap() {}
+
+BoundNodesMap::BoundNodesMap(const BoundNodesMap &Other) {
+  NodeMap = Other.NodeMap;
+}
+
----------------
Why do we need to write them? Isn't that exactly what the compiler generates if we leave them out?

================
Comment at: google3/third_party/llvm/llvm/tools/clang/include/clang/ASTMatchers/ASTMatchersInternal.h:65-66
@@ +64,4 @@
+/// Note that you'll need to add ">::type" just before " type;" as well.
+#define GET_BASE_TYPE(BaseType) \
+  typename llvm::conditional<llvm::is_base_of<BaseType, T>::value, BaseType
+
----------------
The macro below I can live with, this one seems really bad. Also, it's not a lot of repetition, so I think it's not worth is (unless we can significantly simplify the get_base_type.


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



More information about the cfe-commits mailing list