aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2019-02-01[clangd] Unbreak fuzzer targetSam McCall
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352857 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01[clangd] clangDaemonTweaks - fix -DBUILD_SHARED_LIBS=ON buildRoman Lebedev
Followup for rL352841. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352843 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01[clangd] Fix -DBUILD_SHARED_LIBS=ON build - SwapIfBranches needs clangAST.Roman Lebedev
Else, fails with: [1/2] Linking CXX executable bin/clangd FAILED: bin/clangd : && /usr/bin/g++ -pipe -O2 -g0 -UNDEBUG -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-class-memaccess -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -pipe -O2 -g0 -UNDEBUG -fuse-ld=lld -Wl,--color-diagnostics -Wl,-allow-shlib-undefined -Wl,-O3 -Wl,--gc-sections tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o tools/clang/tools/extra/clangd/tool/CMakeFiles/clangd.dir/ClangdMain.cpp.o -o bin/clangd -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.so.9svn -lpthread lib/libclangBasic.so.9svn lib/libclangTidy.so.9svn lib/libclangDaemon.so.9svn lib/libclangFormat.so.9svn lib/libclangFrontend.so.9svn lib/libclangSema.so.9svn lib/libclangTooling.so.9svn lib/libclangToolingCore.so.9svn && : ld.lld: error: undefined symbol: clang::FunctionDecl::getBody(clang::FunctionDecl const*&) const >>> referenced by SwapIfBranches.cpp >>> tools/clang/tools/extra/clangd/refactor/tweaks/CMakeFiles/obj.clangDaemonTweaks.dir/SwapIfBranches.cpp.o:(clang::FunctionDecl::getBody() const) and so on. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352841 91177308-0d34-0410-b5e6-96231b3b80d8
2019-02-01[clangd] Fix crash in applyTweak, remove TweakID alias.Sam McCall
Strings are complicated, giving them opaque names makes us forget they're complicated. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352837 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31[clangd] A code action to swap branches of an if statementIlya Biryukov
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352796 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31[clangd] Append "(fix available)" to diagnostic message when fixes are present.Eric Liu
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352764 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-31[clang-tidy] refactor bugprone-exception-escape analysis into classJonas Toth
Summary: The check `bugprone-exception-escape` does an AST-based analysis to determine if a function might throw an exception and warns based on that information. The analysis part is refactored into a standalone class similiar to `ExprMutAnalyzer` that is generally useful. I intent to use that class in a new check to automatically introduce `noexcept` if possible. Reviewers: aaron.ballman, alexfh, hokein, baloghadamsoftware, lebedev.ri Reviewed By: baloghadamsoftware, lebedev.ri Subscribers: lebedev.ri, mgorny, xazax.hun, rnkovacs, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D57100 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352741 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30[clangd] Drop fixes if replying with tweaks resulted in an errorIlya Biryukov
This should not happen in normal operation, as it implies that the diagnostics with some available fixes were produced but the AST is invalid. Moreover, the code had an error: always returned code actions ignoring the SupportsCodeAction capability and writing a test for this is impossible, since this can only happen due to programmer's error rather than invalid inputs. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352624 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-30[clangd] Fix a use after moveIlya Biryukov
Introduced in r352494. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352612 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29Adjust documentation for git migration.James Y Knight
This fixes most references to the paths: llvm.org/svn/ llvm.org/git/ llvm.org/viewvc/ github.com/llvm-mirror/ github.com/llvm-project/ reviews.llvm.org/diffusion/ to instead point to https://github.com/llvm/llvm-project. This is *not* a trivial substitution, because additionally, all the checkout instructions had to be migrated to instruct users on how to use the monorepo layout, setting LLVM_ENABLE_PROJECTS instead of checking out various projects into various subdirectories. I've attempted to not change any scripts here, only documentation. The scripts will have to be addressed separately. Additionally, I've deleted one document which appeared to be outdated and unneeded: lldb/docs/building-with-debug-llvm.txt Differential Revision: https://reviews.llvm.org/D57330 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352514 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] Remove extra ';' to fix -Wpedantic warning. NFCIlya Biryukov
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352511 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] Attempt to fix failing buildbots after r352494Ilya Biryukov
For failures see: http://lab.llvm.org:8011/builders/clang-x86_64-linux-abi-test/builds/38501/steps/build-unified-tree/logs/stdio git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352510 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] Make -clang-tidy-checks a non-hidden command-line argIlya Biryukov
Summary: This looks like a useful user-facing configuration parameter, which should be discoverable. Also fix a small typo in the description. Reviewers: hokein Reviewed By: hokein Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57384 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352509 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] Unit test for sourceLocationInMainFile.Ilya Biryukov
This should have been part of r352494, which added the corresponding function. The unit test ended up as a separate commit accidentally. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352501 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] Interfaces for writing code tweaksIlya Biryukov
Summary: The code tweaks are an implementation of mini-refactorings exposed via the LSP code actions. They run in two stages: - Stage 1. Decides whether the action is available to the user and collects all the information required to finish the action. Should be cheap, since this will run over all the actions known to clangd on each textDocument/codeAction request from the client. - Stage 2. Uses information from stage 1 to produce the actual edits that the code action should perform. This stage can be expensive and will only run if the user chooses to perform the specified action in the UI. One unfortunate consequence of this change is increased latency of processing the textDocument/codeAction requests, which now wait for an AST. However, we cannot avoid this with what we have available in the LSP today. Reviewers: kadircet, ioeric, hokein, sammccall Reviewed By: sammccall Subscribers: mgrang, mgorny, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56267 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352494 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] dlog clang-tidy configurationHaojian Wu
vlog seems to be too spammy in unittests. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352485 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-29[clangd] Make USRs for macros to be position independentKadir Cetinkaya
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352481 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28[clangd] Index main-file macros (bug 39761)Haojian Wu
Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D55739 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352367 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28[clang-tidy] Fix a build error.Haojian Wu
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352364 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28[clang-tidy] Add the abseil-duration-addition checkHyrum Wright
Differential Revision: https://reviews.llvm.org/D57185 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352362 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-28[clangd] Suggest adding missing includes for incomplete type diagnostics.Eric Liu
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352361 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-26Fix a lit test failure after D54438Kristof Umann
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352290 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25[clang-tidy] fix unit tests for dropped _Float16 support in X86Jonas Toth
Summary: Because _Float16 was disabled for X86 targets the unit-tests started failing. Extract the pieces for _Float16 and run theses tests under AArch64. Reviewers: aaron.ballman, erichkeane, lebedev.ri Reviewed By: erichkeane Subscribers: javed.absar, xazax.hun, kristof.beyls, cfe-commits Differential Revision: https://reviews.llvm.org/D57249 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352231 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25Temporairly disable readability-uppercase-literal-suffix tests that depend ↵Roman Lebedev
on _Float16, to get bots back to green git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352224 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25[clangd] NFC: fix clang-tidy warnings.Haojian Wu
Most are about llvm code style violation (found via readability-identifier-naming check). git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352205 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25[clangd] Log clang-tidy configuration, NFCHaojian Wu
Summary: This is used for debugging purpose. Reviewers: sammccall Subscribers: ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57057 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352184 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-25[clang-tidy] Add check for underscores in googletest names.Haojian Wu
Summary: Adds a clang-tidy warning for underscores in googletest names. Patch by Kar Epker! Reviewers: hokein, alexfh, aaron.ballman Reviewed By: hokein Subscribers: Eugene.Zelenko, JonasToth, MyDeveloperDay, lebedev.ri, xazax.hun, mgorny, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D56424 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352183 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24[clang-tidy] Rename the absl duration helper functions; NFCHyrum Wright
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352088 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24[clangd] Clean the cache of file statuses on vscode-clangd when clangd crashes.Haojian Wu
Summary: Clear the cached file statuses, otherwise we will leave some garbage texts on the status bar when clangd crashes. Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D56540 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352049 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24[CodeComplete] [clangd] Fix crash on ValueDecl with a null typeIlya Biryukov
Reviewers: kadircet Reviewed By: kadircet Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D57093 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352040 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-24[extra] unit tests enable crash-recovery cases on FreeBSDDavid Carlier
Seems the previous statement does not hold up anymore. Reviewers: steveire Reviewed By: steveire Differential Revision: https://reviews.llvm.org/D57102 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@352031 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23[clangd] Workaround a test failure after r351941Ilya Biryukov
This should fix failing buildbots. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351943 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23[clangd] Fix crash due to ObjCPropertyDeclIlya Biryukov
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351941 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23[clangd] Link clangTidy into clangd testsHaojian Wu
Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D57077 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351929 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23[doc] Fix svn property for bugprone-parent-virtual-call.rstZinovy Nis
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351925 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23Revert rCTE351921 to fix documentation geneeration.Stephane Moore
Original review: https://reviews.llvm.org/D56945 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351922 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-23[clang-tidy] Delete obsolete objc-property-declaration options ✂️Stephane Moore
Summary: The `Acronyms` and `IncludeDefaultAcronyms` options were deprecated in https://reviews.llvm.org/D51832. These options can be removed. Tested by running the clang-tidy tests. Reviewers: benhamilton, aaron.ballman Reviewed By: aaron.ballman Subscribers: Eugene.Zelenko, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D56945 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351921 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[doc] Replace 'class' with 'struct' for 'public' by defaultZinovy Nis
Make sample syntax correct. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351867 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[Documentation] Use HTTPS whenever possible.Eugene Zelenko
Differential revision: https://reviews.llvm.org/D56926 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351862 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] Followup fix of rL351818Haojian Wu
ClangTidyOptions::getDefaults is not free, it will initialize all clang-tidy modules to get check-specific options, and we don't use this information in CodeComplete, so using an empty one (constructed by default constructor) is sufficient. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351826 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22Fix "missing field 'ClangTidyOpts' initializer" warning. NFCI.Simon Pilgrim
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351818 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clang-tidy] Fix whitespace in docs. NFCAlexander Kornienko
Actually, just testing commits via monorepo ;) git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351814 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] NFC: reduce log noise from Diagnostics.Eric Liu
Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Differential Revision: https://reviews.llvm.org/D57042 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351813 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] Fix the broken buildbot.Haojian Wu
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351812 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] Fix the `-Wtype-limits` warning, NFCHaojian Wu
The assertion is always true, and triggers a compiler warning, so remove it. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351809 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] NFC: Use buildCompilerInvocation in CodeCompleteKadir Cetinkaya
Reviewers: ilya-biryukov, sammccall Reviewed By: sammccall Subscribers: ioeric, MaskRay, jkorous, arphaman, cfe-commits Differential Revision: https://reviews.llvm.org/D56860 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351793 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] Support clang-tidy configuration in clangd.Haojian Wu
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351792 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-22[clangd] Filter out plugin related flags and move all commandline ↵Kadir Cetinkaya
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 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351788 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-21[clang-tidy] Work around http://llvm.org/PR40392Alexander Kornienko
The readability-else-after-return check should be smarter about cases where the variable defined in the condition is used in the `else` branch. This patch makes it just ignore such cases, but alternative solutions may be better (added a FIXME). git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351751 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-21[clang-tidy] Use getStripPluginsAdjusterKadir Cetinkaya
Summary: See rC351531 for the introduction of getStripPluginsAdjuster. Reviewers: alexfh Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56902 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@351738 91177308-0d34-0410-b5e6-96231b3b80d8