summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/clangd/Compiler.h
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Log cc1 args at verbose level.Sam McCall2019-11-291-2/+2
| | | | | | | | | | | | Summary: This will help debugging driver issues. Reviewers: kbobyrev Subscribers: ilya-biryukov, javed.absar, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D70832
* [clangd] Split Preamble.h out of ClangdUnit.h. NFCSam McCall2019-09-041-2/+2
| | | | | | | | | | | | | | Summary: Add comment describing use of preamble in clangd. Remove deps on ClangdUnit.h where possible. Subscribers: mgorny, ilya-biryukov, javed.absar, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D67117 llvm-svn: 370843
* [clangd] Surface errors from command-line parsingIlya Biryukov2019-08-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Those errors are exposed at the first character of a file, for a lack of a better place. Previously, all errors were stored inside the AST and report accordingly. However, errors in command-line argument parsing could result in failure to produce the AST, so we need an alternative ways to report those errors. We take the following approach in this patch: - buildCompilerInvocation() now requires an explicit DiagnosticConsumer. - TUScheduler and TestTU now collect the diagnostics produced when parsing command line arguments. If pasing of the AST failed, diagnostics are reported via a new ParsingCallbacks::onFailedAST method. If parsing of the AST succeeded, any errors produced during command-line parsing are stored alongside the AST inside the ParsedAST instance and reported as previously by calling the ParsingCallbacks::onMainAST method; - The client code that uses ClangdServer's DiagnosticConsumer does not need to change, it will receive new diagnostics in the onDiagnosticsReady() callback Errors produced when parsing command-line arguments are collected using the same StoreDiags class that is used to collect all other errors. They are recognized by their location being invalid. IIUC, the location is invalid as there is no source manager at this point, it is created at a later stage. Although technically we might also get diagnostics that mention the command-line arguments FileID with after the source manager was created (and they have valid source locations), we choose to not handle those and they are dropped as not coming from the main file. AFAICT, those diagnostics should always be notes, therefore it's safe to drop them without loosing too much information. Reviewers: kadircet Reviewed By: kadircet Subscribers: nridge, javed.absar, MaskRay, jkorous, arphaman, cfe-commits, gribozavr Tags: #clang Differential Revision: https://reviews.llvm.org/D66759 llvm-svn: 370177
* [clangd] Wait for compile command in ASTWorker instead of ClangdServerEric Liu2019-04-151-1/+1
| | | | | | | | | | | | | | | | | | Summary: This makes addDocument non-blocking and would also allow code completion (in fallback mode) to run when worker waits for the compile command. Reviewers: sammccall, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: javed.absar, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60607 llvm-svn: 358400
* [clangd] Stop passing around PCHContainerOperations, just create it in ↵Sam McCall2019-04-041-1/+0
| | | | | | place. NFC llvm-svn: 357689
* Revamp the "[clangd] Format tweak's replacements"Haojian Wu2019-02-111-2/+0
| | | | | | | | | | | | | | | | | | | | Summary: This patch contains two parts: 1) reverts commit r353306. 2) move the format logic out from tweaks, keep tweaks API unchanged. Reviewers: sammccall, ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58051 llvm-svn: 353712
* [clangd] Format tweak's replacements.Haojian Wu2019-02-061-0/+2
| | | | llvm-svn: 353306
* [clangd] Suggest adding missing includes for incomplete type diagnostics.Eric Liu2019-01-281-1/+10
| | | | | | | | | | | | | | | | | | | 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
* [clangd] NFC: Use buildCompilerInvocation in CodeCompleteKadir Cetinkaya2019-01-221-0/+14
| | | | | | | | | | | | Reviewers: ilya-biryukov, sammccall Reviewed By: sammccall Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56860 llvm-svn: 351793
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Lift VFS from clang to llvm (NFC)Jonas Devlieghere2018-10-101-3/+3
| | | | | | | | | | | | | | | | | | | This patch moves the virtual file system form clang to llvm so it can be used by more projects. Concretely the patch: - Moves VirtualFileSystem.{h|cpp} from clang/Basic to llvm/Support. - Moves the corresponding unit test from clang to llvm. - Moves the vfs namespace from clang::vfs to llvm::vfs. - Formats the lines affected by this change, mostly this is the result of the added llvm namespace. RFC on the mailing list: http://lists.llvm.org/pipermail/llvm-dev/2018-October/126657.html Differential revision: https://reviews.llvm.org/D52783 llvm-svn: 344140
* NFC: Enforce good formatting across multiple clang-tools-extra filesKirill Bobyrev2018-08-141-4/+5
| | | | | | | | | | | This patch improves readability of multiple files in clang-tools-extra and enforces LLVM Coding Guidelines. Reviewed by: ioeric Differential Revision: https://reviews.llvm.org/D50707 llvm-svn: 339687
* [clangd] Log all ignored diagnostics.Ilya Biryukov2018-02-121-1/+4
| | | | | | | | | | | | | | | | | Summary: To aid debugging failures and crashes. Only part of ignored diagnostics was logged before, now we log all of them. Reviewers: ioeric, hokein, sammccall Reviewed By: hokein Subscribers: klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43123 llvm-svn: 324888
* [clangd] Always use preamble (even stale) for code completionIlya Biryukov2018-01-181-7/+10
| | | | | | | | | | | | | | | | | | | | | | | Summary: This improves performance of code completion, because we avoid stating the files from the preamble and never attempt to parse the files without using the preamble if it's provided. However, the change comes at a cost of sometimes providing incorrect results when doing code completion after making actually considerable changes to the files used in the preamble or the preamble itself. Eventually the preamble will get rebuilt and code completion will be providing the correct results. Reviewers: bkramer, sammccall, jkorous-apple Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D41991 llvm-svn: 322854
* [clangd] Put all #includes in one block in clangd source files. NFCEric Liu2017-12-141-0/+1
| | | | | | | Clang-format categorizes and sorts #includes with style. It doesn't make sense to manually managing #include blocks. llvm-svn: 320743
* [clangd] Split CodeComplete into a separate file. NFCSam McCall2017-12-041-0/+46
Summary: Shared details of ClangdUnit and CodeComplete moved to a new Compiler file. Reviewers: ilya-biryukov Subscribers: klimek, mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D40719 llvm-svn: 319655
OpenPOWER on IntegriCloud