]> granicus.if.org Git - clang/commit
[Sema] Emit diagnostics for uncorrected delayed typos at the end of TU
authorIlya Biryukov <ibiryukov@google.com>
Wed, 9 Oct 2019 10:00:05 +0000 (10:00 +0000)
committerIlya Biryukov <ibiryukov@google.com>
Wed, 9 Oct 2019 10:00:05 +0000 (10:00 +0000)
commit41d366cc6642c61e0d51de83d7ecf026c1c05c45
tree1a5e50328bad51fbfc003857567ef64fae597c79
parent38ab4b4e93c18afae02391849599be981ee31f54
[Sema] Emit diagnostics for uncorrected delayed typos at the end of TU

Summary:
Instead of asserting all typos are corrected in the sema destructor.

The sema destructor is not run in the common case of running the compiler
with the -disable-free cc1 flag (which is the default in the driver).

Having this assertion led to crashes in libclang and clangd, which are not
reproducible when running the compiler.

Asserting at the end of the TU could be an option, but finding all
missing typo correction cases is hard and having worse diagnostics instead
of a failing assertion is a better trade-off.

For more discussion on this, see:
https://lists.llvm.org/pipermail/cfe-dev/2019-July/062872.html

Reviewers: sammccall, rsmith

Reviewed By: rsmith

Subscribers: usaxena95, dgoldman, jkorous, vsapsai, rnk, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D64799

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374152 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/Sema.cpp
test/SemaObjC/typo-correction-subscript.m