summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Enable more Clang-Tidy checks in pluginrelease_60-basedIvan Donchevskii2018-04-262-1/+29
| | | | | | | | Some of the checks were activated in the Clang-Tidy standalone application but were not in the plugin. Change-Id: I6b6fa01093ae1096c24bf1c47405a5d8480f3e86 Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Fix mingw libclang buildIvan Donchevskii2018-04-261-3/+2
| | | | | | | | | | Mingw miscompiles one of the static variables in Clang-Tidy which results in clang driver wrong return codes. Making it a local static variable solves the issue. Change-Id: I438e1b8d644c742204e88e101c76fd188884089f Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
* Build Clazy inside tools/extraNikolai Kosjar2018-04-201-0/+2
| | | | | | | | | Provide special extra flag for Clazy to make it know it's built inside clang sources and add it's folder as tools/extra subfolder. Change-Id: I3feaff67fbbf8016c09dd88737398417581e6ae9 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
* ReleaseNotes: tidy up, fix some links etc.upstream/release_60Hans Wennborg2018-02-271-82/+57
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_60@326199 91177308-0d34-0410-b5e6-96231b3b80d8
* docs: remove in-progress warningsHans Wennborg2018-02-221-14/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_60@325789 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r323040:Hans Wennborg2018-02-121-4/+3
| | | | | | | | | | | | | | | ------------------------------------------------------------------------ r323040 | dim | 2018-01-20 15:34:33 +0100 (Sat, 20 Jan 2018) | 5 lines Assume the shared library path variable is LD_LIBRARY_PATH on systems except Darwin and Windows. This prevents inserting an environment variable with an empty name (which is illegal and leads to a Python exception) on any of the BSDs. ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_60@324871 91177308-0d34-0410-b5e6-96231b3b80d8
* Merging r321762:Hans Wennborg2018-01-042-2/+9
| | | | | | | | | | | | | | | | | | ------------------------------------------------------------------------ r321762 | juliehockett | 2018-01-03 14:10:11 -0800 (Wed, 03 Jan 2018) | 8 lines [clang-tidy] Update fuchsia-overloaded-operator to check for valid loc Updating fuchsia-overloaded-operator check to not issue warnings for invalid locations. Fixes PR35803. Differential Revision: https://reviews.llvm.org/D41708 ------------------------------------------------------------------------ git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_60@321800 91177308-0d34-0410-b5e6-96231b3b80d8
* Creating release_60 branch off revision 321711Hans Wennborg2018-01-030-0/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/branches/release_60@321719 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Properly set filterText for index-based completion itemsIlya Biryukov2017-12-292-5/+15
| | | | | | | It was previously set to an identifier that the user typed, leading to surprising behavior in VSCode (probably in other editors too). git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321554 91177308-0d34-0410-b5e6-96231b3b80d8
* Avoid int to string conversion in Twine or raw_ostream contexts.Benjamin Kramer2017-12-281-5/+4
| | | | | | | Some output changes from uppercase hex to lowercase hex, no other functionality change intended. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321526 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Get rid of unnecessary global variable. No functionality change.Benjamin Kramer2017-12-282-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321525 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Simplify code. No functionality change intended.Benjamin Kramer2017-12-287-34/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321523 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Skip function bodies when building the preambleIlya Biryukov2017-12-281-0/+10
| | | | | | | | | | | | | | Summary: To make building preambles faster and keep them smaller. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D41495 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321521 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Use Builder for symbol slabs, and use sorted-vector for storageSam McCall2017-12-2311-119/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This improves a few things: - the insert -> freeze -> read sequence is now enforced/communicated by the type system - SymbolSlab::const_iterator iterates over symbols, not over id-symbol pairs - we avoid permanently storing a second copy of the IDs, and the string map's hashtable The slab size is now down to 21.8MB for the LLVM project. Of this only 2.7MB is strings, the rest is #symbols * `sizeof(Symbol)`. `sizeof(Symbol)` is currently 96, which seems too big - I think SymbolInfo isn't efficiently packed. That's a topic for another patch! Also added simple API to see the memory usage/#symbols of a slab, since it seems likely we will continue to care about this. Reviewers: ilya-biryukov Subscribers: klimek, mgrang, cfe-commits Differential Revision: https://reviews.llvm.org/D41506 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321412 91177308-0d34-0410-b5e6-96231b3b80d8
* Reformatting Fuchsia overloaded operator testJulie Hockett2017-12-221-1/+1
| | | | | | Fixing parameters in clang-tidy fuchsia-overloaded-operator test case git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321378 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] Adding Fuchsia checker for overloaded operatorsJulie Hockett2017-12-228-1/+121
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn if an operator is overloaded, except move and copy operators. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D41363 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321363 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Add a tool to build YAML-format global symbols.Haojian Wu2017-12-224-0/+134
| | | | | | | | | | | | | | | | | | | | | | Summary: The tools is used to generate global symbols for clangd (global code completion), The format is YAML, which is only for **experiment**. Usage: ./bin/global-symbol-builder </path/to/llvm-dir> > global-symbols.yaml TEST: used the tool to generate global symbols for LLVM (~72MB). Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41491 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321358 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Simplify GlobalCompilationDatabase, cache missing GCDsSam McCall2017-12-222-47/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321350 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Improve packing of Symbol struct. NFCSam McCall2017-12-222-4/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321348 91177308-0d34-0410-b5e6-96231b3b80d8
* Update test after r321312Paul Robinson2017-12-211-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321323 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Don't re-hash SymbolID in maps, just use the SHA1 dataSam McCall2017-12-212-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321302 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Fix use after free.Benjamin Kramer2017-12-211-3/+4
| | | | | | Found by asan. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321286 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Index symbols share storage within a slab.Sam McCall2017-12-215-14/+35
| | | | | | | | | | | | | | | | | Summary: Symbols are not self-contained - it's only safe to hand them out if you guarantee the lifetime of the underlying data. Before this lands, I'm going to measure the before/after memory usage of the LLVM index loaded into memory in a single slab. Reviewers: hokein Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41483 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321272 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Log more info about preamblesIlya Biryukov2017-12-211-2/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321267 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Use the clang-tools-extra as the official repo for `vscode-clangd` ↵Haojian Wu2017-12-214-15/+88
| | | | | | | | | | | | | | | | | | | | | | | extension. Summary: Previously, we use a separate GitHub repository (https://github.com/llvm-vs-code-extensions/vscode-clangd) for publishing `vscode-clangd` extension to marketplace. To reduce the maintain burden, we will use the vscode extension in the clang-tools-extra, and deprecate the one on GitHub. Test in https://marketplace.visualstudio.com/items?itemName=llvm-vs-code-extensions.clangd-vscode-test Reviewers: sammccall, krasimir Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41391 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321252 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd-fuzzer] Update ClangdLSPServer constructor call.Matt Morehouse2017-12-201-1/+2
| | | | | | Build was broken by r321092. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321226 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Pull CodeCompletionString handling logic into its own file and add ↵Eric Liu2017-12-207-211/+393
| | | | | | | | | | | | unit test. Reviewers: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41450 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321193 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Remove an unused lambda capture.Eric Liu2017-12-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321192 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Switch xrefs and documenthighlight to annotated-code unit tests. NFCSam McCall2017-12-209-500/+462
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The goal here is again to make it easier to read and write the tests. I've extracted `parseTextMarker` from CodeCompleteTests into an `Annotations` class, adding features to it: - as well as points `^s` it allows ranges `[[...]]` - multiple points and ranges are supported - points and ranges may be named: `$name^` and `$name[[...]]` These features are used for the xrefs tests. This also paves the way for replacing the lit diagnostics.test with more readable unit tests, using named ranges. Alternative considered: `TestSelectionRange` in clang-refactor/TestSupport Main problems were: - delimiting the end of ranges is awkward, requiring counting - comment syntax is long and at least as cryptic for most cases - no separate syntax for point vs range, which keeps xrefs tests concise - Still need to convert to Position everywhere - Still need helpers for common case of expecting exactly one point/range (I'll probably promote the extra `PrintTo`s from some of the core Protocol types into `operator<<` in `Protocol.h` itself in a separate, prior patch...) Reviewers: ioeric Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41432 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321184 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Made UniqueFunction's bool conversion explicitIlya Biryukov2017-12-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321173 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix an error in the release notes.Gabor Horvath2017-12-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321169 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] Misc redundant expression checker updated for ineffective ↵Gabor Horvath2017-12-203-2/+193
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | bitwise operator expressions Examples: * Always evaluates to 0: ``` int X; if (0 & X) return; ``` * Always evaluates to ~0: ``` int Y; if (Y | ~0) return; ``` * The symbol is unmodified: ``` int Z; Z &= ~0; ``` Patch by: Lilla Barancsuk! Differential Revision: https://reviews.llvm.org/D39285 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321168 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Add debug printers for basic protocol types. NFCSam McCall2017-12-203-4/+23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321161 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Igore cases in index fuzzy find.Eric Liu2017-12-202-1/+11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321157 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Add "../" to Logger.h included from parent directory.Martin Bohme2017-12-201-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321156 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Don't use the optional "severity" when comparing Diagnostic.Haojian Wu2017-12-192-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: We use Diagnostic as a key to find the corresponding FixIt when we do the "apply-fix", but the "severity" field could be omitted, in some cases, the codeAction request sent from LSP clients (e.g. VScode) doesn't include the `severity` field, which makes clangd fail to find the FixIt. Test the following code in VScode, before the fix, no FixIt shown. ``` void main() {} ^~~~ ``` Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41280 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321106 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Supress a log warning by putting it behind a condition.Eric Liu2017-12-191-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321094 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Build dynamic index and use it for code completion.Eric Liu2017-12-1910-15/+99
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41289 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321092 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Split findDefs/highlights into XRefs, from ClangdUnit. NFCSam McCall2017-12-196-260/+307
| | | | | | | | | Going to add unit tests in the next patch. (Haha!) But seriously there's some work to do first - need to extract the markers-in-source-code parser from CodeComplete test and make it more flexible, to allow annotated ranges etc. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321087 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Fix warnings/compiler pickiness after r321083Sam McCall2017-12-192-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321086 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Index-based code completion.Eric Liu2017-12-199-32/+297
| | | | | | | | | | | | | | Summary: Use symbol index to populate completion results for qualfified IDs e.g. "nx::A^". Reviewers: ilya-biryukov, sammccall Reviewed By: ilya-biryukov, sammccall Subscribers: rwols, klimek, mgorny, cfe-commits, sammccall Differential Revision: https://reviews.llvm.org/D41281 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321083 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Expose offset <-> LSP position functions, and fix bugsSam McCall2017-12-199-30/+152
| | | | | | | | | | | | | | | | | | | | | | | Summary: - Moved these functions to SourceCode.h - added unit tests - fix off by one in positionToOffset: Offset - 1 in final calculation was wrong - fixed formatOnType which had an equal and opposite off-by-one - positionToOffset and offsetToPosition both consistently clamp to beginning/end of file when input is out of range - gave variables more descriptive names - removed windows line ending fixmes where there is nothing to fix - elaborated on UTF-8 fixmes This will conflict with Eric's D41281, but in a pretty easy-to-resolve way. Reviewers: ioeric Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41351 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321073 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Support filtering by fixing scopes in fuzzyFind.Eric Liu2017-12-197-38/+152
| | | | | | | | | | | | | | Summary: When scopes are specified, only match symbols from scopes. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41367 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321067 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Add unit tests for signature help. SigHelp/CodeComplete lit tests ↵Sam McCall2017-12-193-175/+124
| | | | | | are smoke only. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321065 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix more inconsistent line endings. NFC.Dimitry Andric2017-12-182-156/+156
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@321016 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Update documentation page with new features, instructionsMarc-Andre Laperle2017-12-181-8/+25
| | | | | | | | | | | | | | | | | | | | Summary: - Some features were implemented so mark them as such. - Add installation instructions (LLVM debian packages) Signed-off-by: Marc-Andre Laperle <marc-andre.laperle@ericsson.com> Reviewers: jkorous-apple Reviewed By: jkorous-apple Subscribers: jkorous-apple, klimek, ilya-biryukov, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D41306 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320988 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] in VSCode client, filter extensions properly and only accept file: URIsSam McCall2017-12-181-4/+4
| | | | | | | | | | | | | | | | | | | Summary: The filtering wasn't previously working as intended - the string list is interpreted as a list of editor modes, not file extensions. (It happens to mostly work as "c" and "cpp" are the names of modes, but we're missing objective-c) The file: restriction is new - clangd needs to be able to convert URI<->path in order to determine how to build. Reviewers: hokein Subscribers: klimek, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41343 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320972 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tidy] Adding Fuchsia checker for virtual inheritanceJulie Hockett2017-12-158-0/+142
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn if classes are defined with virtual inheritance. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D40813 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320841 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Build in-memory index on symbols in files.Eric Liu2017-12-156-102/+260
| | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41276 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320807 91177308-0d34-0410-b5e6-96231b3b80d8
* [clangd] Put all #includes in one block in clangd source files. NFCEric Liu2017-12-1415-23/+10
| | | | | | | Clang-format categorizes and sorts #includes with style. It doesn't make sense to manually managing #include blocks. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@320743 91177308-0d34-0410-b5e6-96231b3b80d8