[cfe-commits] [PATCH] Introduces DynTypedMatcher as a new concept that replaces the UntypedBaseMatcher and TypedMatcher. Due to DynTypedNode the basic dynamically typed matcher interface can now be simplified.
Michael Diamond
reviews at llvm-reviews.chandlerc.com
Wed Sep 5 15:43:21 PDT 2012
LGTM.
================
Comment at: include/clang/ASTMatchers/ASTTypeTraits.h:86
@@ -71,1 +85,3 @@
+ /// pointers and thus need to be stored by value.
+ llvm::AlignedCharArrayUnion<Decl*, Stmt*, QualType> Storage;
};
----------------
Daniel Jasper wrote:
> Michael Diamond wrote:
> > I think it would be better to use boost::any here. Then you don't have to explicitly specify all the types. You will still be able to store the QualType by value, but you won't have to worry about it in the declaration of Storage.
> LLVM and Boost don't mix ;-).... Boost is quite massive and would create a significant burden on clang. The specialized abstractions provided by LLVM are quite sufficient for most use cases.
>
> The best data structure would probably by a union, however until we can use C++11, unions don't support members with non-trivial constructors. That is why we use this helper structure for the time being.
Hrmm... I talked briefly with Manuel about adding the Any abstraction to llvm/Support and I tried to broach the idea on the IRC channel but didn't get any response. I think that's the way to go in the future, but in the short term, I don't think it should hold up this CL.
http://llvm-reviews.chandlerc.com/D33
BRANCH
hasancestor
More information about the cfe-commits
mailing list