[PATCH] D38708: [AST] Flag the typo-corrected nodes for better tooling

Alex Lorenz via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 9 15:32:34 PDT 2017


arphaman created this revision.

This patch adds a new boolean field to the `DeclRefExpr`, `MemberExpr`, `CXXCtorInitializer`, `ObjCIvarRefExpr`, `ObjCPropertyRefExpr` nodes which is set to true when these nodes have been produced during typo-correction.

This is useful for Clang-based tooling as it can distinguish between true references and the typo-corrected references. The initial tooling support uses the flag to prevent token annotation for typo-corrected references and to prevent finding typo-corrected references during single TU reference search.


Repository:
  rL LLVM

https://reviews.llvm.org/D38708

Files:
  include/clang/AST/DeclCXX.h
  include/clang/AST/Expr.h
  include/clang/AST/ExprObjC.h
  include/clang/AST/Stmt.h
  lib/AST/DeclCXX.cpp
  lib/AST/Expr.cpp
  lib/Sema/SemaDecl.cpp
  lib/Sema/SemaDeclCXX.cpp
  lib/Sema/SemaExprCXX.cpp
  lib/Sema/SemaExprMember.cpp
  lib/Sema/SemaExprObjC.cpp
  lib/Sema/SemaOverload.cpp
  lib/Sema/SemaPseudoObject.cpp
  lib/Sema/SemaTemplateInstantiateDecl.cpp
  lib/Sema/TreeTransform.h
  lib/Serialization/ASTReader.cpp
  lib/Serialization/ASTReaderStmt.cpp
  lib/Serialization/ASTWriter.cpp
  lib/Serialization/ASTWriterDecl.cpp
  lib/Serialization/ASTWriterStmt.cpp
  test/Index/typo-annotate-tokens.mm
  test/Index/typo-file-refs.cpp
  test/Index/typo-file-refs.m
  tools/libclang/CIndex.cpp
  tools/libclang/CIndexHigh.cpp
  tools/libclang/CursorVisitor.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D38708.118283.patch
Type: text/x-patch
Size: 40119 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20171009/7d7044e9/attachment-0001.bin>


More information about the cfe-commits mailing list