MemberTypoDiags looks like it'd be very well-written as a lambda (it's just forwarding state to the operator() call). This would imply changing the underlying API from unique_ptr<TypoDiagnosticGenerator>, removing TypoDiagnosticGenerator, and using std::function<void (const TypoCorrection &TC)> instead. The callers would then just pass in lambdas and std::function would provide the type erasure, dynamic destruction, etc.
MemberExprTypoRecovery is a bit longer, but still does seem like a lambda might suite (& even if it doesn't - writing it as a functor (which it already is - but you would/could strip off the base class and the virtuality of the op()) and having the API use std::function is a bit more flexible) Otherwise this all looks /fairly/ straightforward (again, I don't have all the domain knowledge to judge this - the getDeclFromExpr and its use might use comments (and/or the added code that uses it might be pulled out into another function with a self-documenting name)). But again, some of this is probably just my unfamiliarity with the code. On Thu, Sep 25, 2014 at 2:00 PM, Kaelyn Takata <[email protected]> wrote: > ping > > On Tue, Aug 26, 2014 at 11:06 AM, Kaelyn Takata <[email protected]> wrote: > >> +dblaikie >> >> >> On Thu, Jul 31, 2014 at 1:20 PM, Kaelyn Takata <[email protected]> wrote: >> >>> >>> This includes adding the new TypoExpr-based lazy typo correction to >>> LookupMemberExprInRecord as an alternative to the existing eager typo >>> correction. >>> --- >>> lib/Sema/SemaExprCXX.cpp | 40 ++++++++++- >>> lib/Sema/SemaExprMember.cpp | 116 >>> ++++++++++++++++++++++++++++--- >>> test/SemaCXX/arrow-operator.cpp | 5 +- >>> test/SemaCXX/typo-correction-delayed.cpp | 32 +++++++++ >>> test/SemaCXX/typo-correction-pt2.cpp | 2 +- >>> test/SemaCXX/typo-correction.cpp | 10 +-- >>> 6 files changed, 186 insertions(+), 19 deletions(-) >>> create mode 100644 test/SemaCXX/typo-correction-delayed.cpp >>> >>> >> >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
