summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/IncludeFixer.h
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Compute scopes eagerly in IncludeFixerIlya Biryukov2019-08-061-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Computing lazily leads to crashes. In particular, computing scopes may produce diagnostics (from inside template instantiations) and we currently do it when processing another diagnostic, which leads to crashes. Moreover, we remember and access 'Scope*' when computing scopes. This might lead to invalid memory access if the Scope is deleted by the time we run the delayed computation. We did not actually construct an example when this happens, though. From the VCS and review history, it seems the optimization was introduced in the initial version without a mention of any performance benchmarks justifying the performance gains. This led me to a conclusion that the optimization was premature, so removing it to avoid crashes seems like the right trade-off at that point. Reviewers: sammccall Reviewed By: sammccall Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65796 llvm-svn: 368019
* Moved Symbol into its own header and implementation fileDmitri Gribenko2019-02-281-0/+1
| | | | | | | | | | | | Reviewers: ioeric Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58774 llvm-svn: 355088
* [clangd] Cache include fixes for diagnostics caused by the same unresolved ↵Eric Liu2019-02-181-1/+13
| | | | | | | | | | | | | | | | | | | | | | name or incomplete type. Summary: Multiple diagnostics can be caused by the same unresolved name or incomplete type, especially if the code is copy-pasted without #includes. The cache can avoid making repetitive index requests, and thus reduce latency and allow more diagnostics to be fixed (we limit the number of index requests for each parse). Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58239 llvm-svn: 354268
* [clangd] Suggest adding missing includes for typos (like include-fixer).Eric Liu2019-02-071-2/+35
| | | | | | | | | | | | | | | | | | | Summary: This adds include-fixer feature into clangd based on D56903. Clangd now captures diagnostics caused by typos and attach include insertion fixes to potentially fix the typo. Reviewers: sammccall Reviewed By: sammccall Subscribers: cfe-commits, kadircet, arphaman, mgrang, jkorous, MaskRay, javed.absar, ilya-biryukov, mgorny Tags: #clang Differential Revision: https://reviews.llvm.org/D57021 llvm-svn: 353380
* [clangd] Suggest adding missing includes for incomplete type diagnostics.Eric Liu2019-01-281-0/+54
Summary: This enables clangd to intercept compiler diagnostics and attach fixes (e.g. by querying index). This patch adds missing includes for incomplete types e.g. member access into class with only forward declaration. This would allow adding missing includes for user-typed symbol names that are missing declarations (e.g. typos) in the future. Reviewers: sammccall Reviewed By: sammccall Subscribers: mgorny, ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56903 llvm-svn: 352361
OpenPOWER on IntegriCloud