[PATCH v4 5/8] Start adding the infrastructure for handling TypoExprs.

Kaelyn Takata rikka at google.com
Thu Jul 31 13:20:29 PDT 2014


Part of the infrastructure is a map from a TypoExpr to the Sema-specific
state needed to correct it, along with helpers to ease dealing with the
state.

The the typo count is propagated up the stack of
ExpressionEvaluationContextRecords when one is popped off of to
avoid accidentally dropping TypoExprs on the floor. For example,
the attempted correction of g() in test/CXX/class/class.mem/p5-0x.cpp
happens with an ExpressionEvaluationContextRecord that is popped off
the stack prior to ActOnFinishFullExpr being called and the tree
transform for TypoExprs being run.
---
 include/clang/Sema/Sema.h           |  44 +++++
 include/clang/Sema/SemaInternal.h   |  15 +-
 include/clang/Sema/TypoCorrection.h |   2 +-
 lib/Sema/SemaExpr.cpp               |   7 +
 lib/Sema/SemaExprCXX.cpp            | 108 ++++++++++++
 lib/Sema/SemaLookup.cpp             | 316 ++++++++++++++++++++++++------------
 6 files changed, 384 insertions(+), 108 deletions(-)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4-0005-Start-adding-the-infrastructure-for-handling-Typo.patch
Type: text/x-patch
Size: 32900 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20140731/01dc618c/attachment.bin>


More information about the cfe-commits mailing list