summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/unittests
Commit message (Collapse)AuthorAgeFilesLines
...
* [clangd] Fix crash in applyTweak, remove TweakID alias.Sam McCall2019-02-011-6/+4
| | | | | | | Strings are complicated, giving them opaque names makes us forget they're complicated. llvm-svn: 352837
* [clangd] A code action to swap branches of an if statementIlya Biryukov2019-01-312-0/+161
| | | | | | | | | | | | | | Reviewers: sammccall Reviewed By: sammccall Subscribers: llvm-commits, mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D56611 llvm-svn: 352796
* [clangd] Append "(fix available)" to diagnostic message when fixes are present.Eric Liu2019-01-311-1/+2
| | | | | | | | | | | | | | | | Summary: This would make diagnostic fixits more discoverable, especially for plugins like YCM. Reviewers: sammccall Reviewed By: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57509 llvm-svn: 352764
* [clangd] Unit test for sourceLocationInMainFile.Ilya Biryukov2019-01-291-0/+36
| | | | | | | This should have been part of r352494, which added the corresponding function. The unit test ended up as a separate commit accidentally. llvm-svn: 352501
* [clangd] Make USRs for macros to be position independentKadir Cetinkaya2019-01-291-1/+7
| | | | | | | | | | | | | | Summary: USRs for macros were not cannonical due to usage of cursor location instead of definition location. Reviewers: jkorous Subscribers: ilya-biryukov, ioeric, MaskRay, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D57228 llvm-svn: 352481
* [clangd] Index main-file macros (bug 39761)Haojian Wu2019-01-282-19/+28
| | | | | | | | Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D55739 llvm-svn: 352367
* [clangd] Suggest adding missing includes for incomplete type diagnostics.Eric Liu2019-01-2810-311/+434
| | | | | | | | | | | | | | | | | | | 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: fix clang-tidy warnings.Haojian Wu2019-01-251-3/+3
| | | | | | | Most are about llvm code style violation (found via readability-identifier-naming check). llvm-svn: 352205
* [CodeComplete] [clangd] Fix crash on ValueDecl with a null typeIlya Biryukov2019-01-241-0/+11
| | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D57093 llvm-svn: 352040
* [clangd] Workaround a test failure after r351941Ilya Biryukov2019-01-231-2/+4
| | | | | | This should fix failing buildbots. llvm-svn: 351943
* [clangd] Fix crash due to ObjCPropertyDeclIlya Biryukov2019-01-231-0/+15
| | | | | | | | | | | | With ObjCPropertyDecl, ASTNode.OrigD can be a ObjCPropertyImplDecl which is not a NamedDecl, leading to a crash since the code incorrectly assumes ASTNode.OrigD will always be a NamedDecl. Change by dgoldman (David Goldman)! Differential Revision: https://reviews.llvm.org/D56916 llvm-svn: 351941
* [clangd] Link clangTidy into clangd testsHaojian Wu2019-01-231-0/+1
| | | | | | | | Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D57077 llvm-svn: 351929
* [clangd] Support clang-tidy configuration in clangd.Haojian Wu2019-01-225-2/+11
| | | | | | | | | | | | | | | | | | | | | Summary: This patch adds some basic supports for clang-tidy configurations in clangd: - clangd will respect .clang-tidy configurations for each file - we don't aim to support all clang-tidy options in clangd, only a small subset of condfigurations (options related to which checks will be enabled) are supported. - add a `clang-tidy-checks` CLI option that can override options from .clang-tidy file Reviewers: ilya-biryukov, sammccall Reviewed By: sammccall Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55256 llvm-svn: 351792
* [clangd] Filter out plugin related flags and move all commandline ↵Kadir Cetinkaya2019-01-223-14/+37
| | | | | | | | | | | | | | | | | | | | manipulations into OverlayCDB. Summary: Some projects make use of clang plugins when building, but clangd is not aware of those plugins therefore can't work with the same compile command arguments. There were multiple places clangd performed commandline manipulations, this one also moves them all into OverlayCDB. Reviewers: ilya-biryukov Subscribers: klimek, sammccall, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56841 llvm-svn: 351788
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-1964-256/+192
| | | | | | | | | | | | | | | | | 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
* [clangd] XPC transport layerJan Korous2019-01-163-0/+61
| | | | | | | | | | | | - New transport layer for macOS. - XPC Framework - Test client Framework and client were written by Alex Lorenz. Differential Revision: https://reviews.llvm.org/D54428 llvm-svn: 351280
* [clangd] Fix updated file detection logic in indexingKadir Cetinkaya2019-01-151-1/+72
| | | | | | | | | | | | | | | | | Summary: Files without any symbols were never marked as updated during indexing, which resulted in failure while writing shards for these files. This patch fixes the logic to mark files that are seen for the first time but don't contain any symbols as updated. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56592 llvm-svn: 351170
* [clangd] Add Limit parameter for xref.Haojian Wu2019-01-143-9/+29
| | | | | | | | | | Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56597 llvm-svn: 351081
* [clangd] Index main-file symbols (bug 39761)Sam McCall2019-01-143-30/+88
| | | | | | | | Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D55185 llvm-svn: 351041
* [clangd] Introduce loading of shards within auto-indexKadir Cetinkaya2019-01-101-1/+80
| | | | | | | | | | | | | | | | Summary: Whenever a change happens on a CDB, load shards associated with that CDB before issuing re-index actions. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55224 llvm-svn: 350847
* [clangd] Don't store completion info if the symbol is not used for code ↵Haojian Wu2019-01-101-4/+9
| | | | | | | | | | | | | | | | | | | | | completion. Summary: This would save us some memory and disk space: - Dex usage (261 MB vs 266 MB) - Disk (75 MB vs 76 MB) It would save more when we index the main file symbol D55185. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: nridge, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56314 llvm-svn: 350803
* [clangd] Add a test for SignatureHelp on dynamic index.Haojian Wu2019-01-091-0/+31
| | | | | | | | | | | | Summary: This would catch regressions caused by future changes of the index. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56483 llvm-svn: 350720
* [clangd] Fix a crash when reading an empty index file.Haojian Wu2019-01-081-0/+4
| | | | | | | | | | | | | | | Summary: Unfortunately, yaml::Input::setCurrentDocument() and yaml::Input::nextDocument() are internal APIs, the way we use them may cause a nullptr accessing when processing an empty YAML file. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56442 llvm-svn: 350633
* [clangd] Include <cstdio> instead of <stdio.h>. NFCIlya Biryukov2019-01-071-1/+1
| | | | | | This fixes the only clang-tidy check currently enabled by clangd. llvm-svn: 350540
* [clangd] Remove 'using namespace llvm' from .cpp files. NFCIlya Biryukov2019-01-0733-347/+343
| | | | | | | | The new guideline is to qualify with 'llvm::' explicitly both in '.h' and '.cpp' files. This simplifies moving the code between header and source files and is easier to keep consistent. llvm-svn: 350531
* [clangd] Fix a regression issue caused by r348365.Haojian Wu2019-01-071-4/+7
| | | | | | | | | | | | | | | | | | | | | Summary: With r348365, we now detect libc++ dir using the actual compiler path (from the compilation command), rather than the resource-dir. This new behavior will cause clangd couldn't find libc++ dir (even the libc++ is built from the source) when using a fallback compilation command (`clang xxx`) The fix is to use `<clangd_install_dir>/clang` as the actual compiler path. Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56380 llvm-svn: 350515
* [clangd] Disable BackgroundIndexTest.PeriodicalIndexIlya Biryukov2019-01-071-1/+3
| | | | | | It sometimes fails on AArch64. llvm-svn: 350512
* [clangd] clang-format everything. NFCIlya Biryukov2019-01-0314-250/+208
| | | | llvm-svn: 350303
* [clangd] Cleanup syntax errors in the test, NFC.Haojian Wu2018-12-214-7/+7
| | | | llvm-svn: 349893
* [clangd] Try to workaround test failure by increasing the timeoutsIlya Biryukov2018-12-201-3/+3
| | | | | | | | Ideally we'd figure out a way to run this test without any sleeps, this workaround is only there to avoid annoying people with test failures around the holiday period when everyone is on vacation. llvm-svn: 349769
* [clangd] Don't miss the expected type in merge.Haojian Wu2018-12-201-0/+2
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55918 llvm-svn: 349750
* [clangd] Fix a syntax error on the test.Haojian Wu2018-12-191-1/+1
| | | | llvm-svn: 349632
* [clangd] Try to fix buildbot failure after r349496Eric Liu2018-12-181-3/+3
| | | | | | | Increase timeout from 10ms to 100ms. See http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/27959 llvm-svn: 349502
* [clangd] BackgroundIndex rebuilds symbol index periodically.Eric Liu2018-12-181-0/+37
| | | | | | | | | | | | | | | | | | Summary: Currently, background index rebuilds symbol index on every indexed file, which can be inefficient. This patch makes it only rebuild symbol index periodically. As the rebuild no longer happens too often, we could also build more efficient dex index. Reviewers: ilya-biryukov, kadircet Reviewed By: kadircet Subscribers: dblaikie, MaskRay, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D55770 llvm-svn: 349496
* [clangd] Use buildCompilerInvocation to simplify the HeadersTests, NFC.Haojian Wu2018-12-141-10/+4
| | | | llvm-svn: 349148
* [clangd] Fix memory leak in ClangdTests.Haojian Wu2018-12-141-1/+3
| | | | | | | | | | | | | | | | | Summary: createInvocationFromCommandLine sets DisableFree to true by default, which leads memory leak in clangd. The fix is to use the `BuildCompilationInvocation` to create CI with the correct options (DisableFree is false). Fix https://bugs.llvm.org/show_bug.cgi?id=39991. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55702 llvm-svn: 349145
* [clangd] Fix an assertion failure in background index.Haojian Wu2018-12-141-0/+19
| | | | | | | | | | | | | | | Summary: When indexing a file which contains an uncompilable error, we will trigger an assertion failure -- the IndexFileIn data is not set, but we access them in the backgound index. Reviewers: kadircet Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55650 llvm-svn: 349144
* [clangd] Refine the way of checking a declaration is referenced by the ↵Haojian Wu2018-12-131-0/+47
| | | | | | | | | | | | | | | | | written code. Summary: The previous solution (checking the AST) is not a reliable way to determine whether a declaration is explicitly referenced by the source code, we are still missing a few cases. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55191 llvm-svn: 349033
* [clangd] Avoid emitting Queued status when we are able to acquire the Barrier.Haojian Wu2018-12-131-2/+0
| | | | | | | | | | Reviewers: ilya-biryukov Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55359 llvm-svn: 349032
* Add explicit dependency on clangSerialization after rC348911Fangrui Song2018-12-128-0/+8
| | | | llvm-svn: 348916
* [clangd] Remove the test that sometimes deadlocksIlya Biryukov2018-12-061-23/+0
| | | | | | Will figure out how to properly rewrite it and recommit. llvm-svn: 348490
* [clangd] Update the test codeHaojian Wu2018-12-061-4/+0
| | | | | | I forgot to update it in the last round of code review. llvm-svn: 348478
* [clangd] C++ API for emitting file status.Haojian Wu2018-12-061-1/+79
| | | | | | Introduce clangd C++ API to emit the current status of file. llvm-svn: 348475
* [clangd] Fix a typo in TUSchedulerTestsHaojian Wu2018-12-061-1/+1
| | | | | | | | | | | | Reviewers: ilya-biryukov Reviewed By: ilya-biryukov Subscribers: javed.absar, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55312 llvm-svn: 348467
* [clangd] Dont provide locations for non-existent files.Kadir Cetinkaya2018-12-051-0/+12
| | | | | | | | | | | | | | Summary: We were getting assertion errors when we had bad file names, instead we should skip those. Reviewers: hokein Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55275 llvm-svn: 348359
* Fix compilation error when using clang 3.6.0Mikael Holmen2018-12-051-3/+3
| | | | llvm-svn: 348357
* [clangd] Partition include graph on auto-index.Kadir Cetinkaya2018-12-041-3/+59
| | | | | | | | | | | | | | Summary: Partitions include graphs in auto-index so that each shards contains only part of the include graph related to itself. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55062 llvm-svn: 348252
* [clangd] Populate include graph during static indexing action.Kadir Cetinkaya2018-11-302-0/+231
| | | | | | | | | | | | | | | Summary: This is the second part for introducing include hierarchy into index files produced by clangd. You can see the base patch that introduces structures and discusses the future of the patches in D54817 Reviewers: ilya-biryukov Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D54999 llvm-svn: 348005
* [clangd] Penalize destructor and overloaded operators in code completion.Eric Liu2018-11-301-8/+43
| | | | | | | | | | Reviewers: hokein Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D55061 llvm-svn: 347983
* [clangd] Drop injected class name when class scope is not explicitly specified.Eric Liu2018-11-301-0/+5
| | | | | | | | | | | | Summary: E.g. allow injected "A::A" in `using A::A^` but not in "A^". Reviewers: kadircet Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D55065 llvm-svn: 347982
OpenPOWER on IntegriCloud