aaron.ballman added inline comments. ================ Comment at: lib/ASTMatchers/Dynamic/Marshallers.h:102 @@ +101,3 @@ + static clang::CastKind getCastKind(llvm::StringRef AttrKind) { + return llvm::StringSwitch<clang::CastKind>(AttrKind) + .Case("CK_Dependent", CK_Dependent) ---------------- This might be an awful idea, but let's explore it.
What if we moved the CastKind enumerator names into a .def (or .inc) file and use macros to generate the enumeration as well as this monster switch statement? We do this in other places where it makes sense to do so, such as in Expr.h: ``` enum AtomicOp { #define BUILTIN(ID, TYPE, ATTRS) #define ATOMIC_BUILTIN(ID, TYPE, ATTRS) AO ## ID, #include "clang/Basic/Builtins.def" // Avoid trailing comma BI_First = 0 }; ``` http://reviews.llvm.org/D19871 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits