summaryrefslogtreecommitdiffstats
path: root/clang-query
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-051-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@319840 91177308-0d34-0410-b5e6-96231b3b80d8
* [NFC] Update to account for DiagnosticRenderer use of FullSourceLocPeter Smith2017-06-271-4/+4
| | | | | | | | | | | | | | | | D31709 [NFC] Refactor DiagnosticRenderer to use FullSourceLoc was committed in r305684 and reverted in 305688 as clang-tidy and clang-query failed to build. This change updates the extra tools to use the new interface. Reviewers: christof, rnk, rsmith, rovka, alexfh Reviewed By: alexfh Differential Revision: https://reviews.llvm.org/D34513 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@306385 91177308-0d34-0410-b5e6-96231b3b80d8
* modernize-use-auto NFC fixesPiotr Padlewski2016-12-143-15/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@289656 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang2016-11-084-25/+13
| | | | | | | | | | | | | | | | Summary: Ran clang-format on all .c/.cpp/.h files in clang-tools-extra. Excluded the test, unittests, clang-reorder-fields, include-fixer, modularize and pptrace directories. Reviewers: klimek, alexfh Subscribers: nemanjai Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D26329 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@286221 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-query] Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons2016-11-011-2/+2
| | | | | | | | | | Reviewers: pcc, dblaikie Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D26205 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@285731 91177308-0d34-0410-b5e6-96231b3b80d8
* Update to match LLVM r272232.Richard Smith2016-06-091-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@272235 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.Eugene Zelenko2016-03-171-2/+2
| | | | | | | Differential revision: http://reviews.llvm.org/D18231 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@263726 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove autoconf supportChris Bieneman2016-01-262-55/+0
| | | | | | | | | | | | | | | | Summary: This patch is provided in preparation for removing autoconf on 1/26. The proposal to remove autoconf on 1/26 was discussed on the llvm-dev thread here: http://lists.llvm.org/pipermail/llvm-dev/2016-January/093875.html "Now I am become Death, the destroyer of worlds." -J. Robert Oppenheimer Reviewers: chandlerc, grosbach, bob.wilson, echristo Subscribers: cfe-commits, klimek Differential Revision: http://reviews.llvm.org/D16475 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@258864 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Apply modernize-use-default to clang-tools-extra."David Blaikie2015-10-201-1/+1
| | | | | | | | | Breaks the build in GCC 4.7.2 (see http://lab.llvm.org:8011/builders/perf-x86_64-penryn-O3 for example) This reverts commit r250824. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@250862 91177308-0d34-0410-b5e6-96231b3b80d8
* Apply modernize-use-default to clang-tools-extra.Angel Garcia Gomez2015-10-201-1/+1
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: klimek Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13889 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@250824 91177308-0d34-0410-b5e6-96231b3b80d8
* Install clang-query by default.Manuel Klimek2015-09-281-0/+2
| | | | | | | It is already installed by the autotools build, and it is useful for developers who are not working on LLVM/Clang itself. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@248710 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the "quit" command as a way to terminate clang-query interactive sessions.Aaron Ballman2015-08-065-2/+26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@244206 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing dependency clangFrontend to clangQuery.Adrian Prantl2015-06-201-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240227 91177308-0d34-0410-b5e6-96231b3b80d8
* Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko2015-04-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: The patch is generated using clang-tidy misc-use-override check. This command was used: tools/clang/tools/extra/clang-tidy/tool/run-clang-tidy.py \ -checks='-*,misc-use-override' -header-filter='llvm|clang' -j=32 -fix svn diff | clang-format-diff -i Reviewers: dblaikie Reviewed By: dblaikie Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D8927 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@234681 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'let' to the help message.Samuel Benzaquen2015-02-271-4/+8
| | | | | | | | | | | | Summary: Add 'let' to the help message. Reviewers: alexfh Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D7940 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230768 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl2015-02-251-3/+2
| | | | | | This reverts commit 230424. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230456 91177308-0d34-0410-b5e6-96231b3b80d8
* Adapt clang-tools-extra to clang module format changes.Adrian Prantl2015-02-251-2/+3
| | | | | | | - add clangCodeGen.a to the tools that need it - tweak pp-trace command line handling to not conflict with clang's. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230424 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Adapt Makefile dependencies for the clang module format change in ↵Adrian Prantl2015-02-211-4/+2
| | | | | | r230089." git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230104 91177308-0d34-0410-b5e6-96231b3b80d8
* Adapt Makefile dependencies for the clang module format change in r230089.Adrian Prantl2015-02-201-2/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230090 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove call to llvm::makeArrayRef. Implicit conversion is sufficient.Craig Topper2014-08-291-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@216711 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify creation of a couple ArrayRefs by using None and makeArrayRef.Craig Topper2014-08-271-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@216529 91177308-0d34-0410-b5e6-96231b3b80d8
* [clang-query] Use the new API for named values from the Parser.Samuel Benzaquen2014-08-121-18/+5
| | | | | | | | | | | | Summary: This finishes the support for autocomplete for user defined values.. Reviewers: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4851 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@215474 91177308-0d34-0410-b5e6-96231b3b80d8
* Use CommonOptionsParser in clang-query. This fixes its support of the fixedAlexander Kornienko2014-08-021-26/+11
| | | | | | | | | | | | | | compilation database and makes it behave consistently with other clang tools. Reviewers: klimek, pcc Reviewed By: pcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D4763 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@214607 91177308-0d34-0410-b5e6-96231b3b80d8
* Track clang r213171Alp Toker2014-07-161-1/+1
| | | | | | The clang rewriter is now a core facility. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213172 91177308-0d34-0410-b5e6-96231b3b80d8
* Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.NAKAMURA Takumi2014-07-151-1/+0
| | | | | | I checked this with Release+Asserts on x86_64-mingw32. Please restore partially if this were overkill. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@213064 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Update libdeps.NAKAMURA Takumi2014-07-141-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code. No functional change.Craig Topper2014-06-101-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210508 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'.Craig Topper2014-06-091-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210447 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix clang-query on Windows: flush llvm::outs() after each command.Manuel Klimek2014-05-211-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209313 91177308-0d34-0410-b5e6-96231b3b80d8
* Slightly less blindly fixing clang-tools-extra now that I remember that the ↵David Blaikie2014-04-251-4/+1
| | | | | | "check-clang" target doesn't check clang-tools-extra git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@207231 91177308-0d34-0410-b5e6-96231b3b80d8
* Blindly try to fix the clang-tools-extra build since my local build doesn't ↵David Blaikie2014-04-252-5/+3
| | | | | | appear to be picking it up git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@207230 91177308-0d34-0410-b5e6-96231b3b80d8
* QueryParser::doParse(): Fix msc17 build. Don't use initializer list.NAKAMURA Takumi2014-04-231-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@206998 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new 'let' command to bind arbitrary values into constants.Samuel Benzaquen2014-04-236-38/+125
| | | | | | | | | | | | | | Summary: Add new 'let' command to bind arbitrary values into constants. These constants can then be used in the matcher expressions. Reviewers: pcc CC: cfe-commits Differential Revision: http://reviews.llvm.org/D3383 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@206984 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-091-3/+2
| | | | | | | | This removes all references to OwningPtr, which should be fairly undisruptive to out-of-tree projects since they are unlikely to use clang-tools-extra as a library instead of a set of tools. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@203382 91177308-0d34-0410-b5e6-96231b3b80d8
* [cleanup] Re-sort headers with llvm/utils/sort_includes.py.Chandler Carruth2014-03-042-3/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@202809 91177308-0d34-0410-b5e6-96231b3b80d8
* Documentation comments: fix incorrect usage of \paramDmitri Gribenko2014-03-021-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@202649 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace LLVM_OVERRIDE with 'override'Craig Topper2014-03-021-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@202632 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] Use LINK_LIBS instead of target_link_libraries().NAKAMURA Takumi2014-02-261-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@202238 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a makefile for clang-query. Patch by Alex Horn!Peter Collingbourne2014-02-183-10/+48
| | | | | | | While at it, have cmake build and test the tool if libedit is not installed, as this dependency is now optional. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@201599 91177308-0d34-0410-b5e6-96231b3b80d8
* Add completion to the query parser, and hook it up to clang-query.Peter Collingbourne2014-02-013-46/+160
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2263 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@200604 91177308-0d34-0410-b5e6-96231b3b80d8
* Switch clang-query to use the lineeditor library.Peter Collingbourne2014-02-012-29/+6
| | | | | | Differential Revision: http://llvm-reviews.chandlerc.com/D2262 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@200603 91177308-0d34-0410-b5e6-96231b3b80d8
* Run llvm/utils/sort_includes.py over the Clang tools code. This doesn'tChandler Carruth2014-01-074-8/+6
| | | | | | | | | | always produce as pretty of results as it does in LLVM and Clang, but I don't mind and the value of having a single canonical ordering is very high IMO. Let me know if you spot really serious problems here. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@198703 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake] clang-tools-extra: Update dependencies.NAKAMURA Takumi2013-12-101-0/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@196860 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r194247 conditional on non-MSVC.Peter Collingbourne2013-11-081-0/+5
| | | | | | | These definitions are required by the standard. MSVC rejecting them appears to be a bug. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@194252 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-query: Unbreak msvc.NAKAMURA Takumi2013-11-081-3/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@194247 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence GCC warning.Peter Collingbourne2013-11-081-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@194230 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce clang-query tool.Peter Collingbourne2013-11-089-0/+674
This tool is for interactive exploration of the Clang AST using AST matchers. It currently allows the user to enter a matcher at an interactive prompt and view the resulting bindings as diagnostics, AST pretty prints or AST dumps. Example session: $ cat foo.c void foo(void) {} $ clang-query foo.c -- clang-query> match functionDecl() Match #1: foo.c:1:1: note: "root" binds here void foo(void) {} ^~~~~~~~~~~~~~~~~ 1 match. Differential Revision: http://llvm-reviews.chandlerc.com/D2098 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@194227 91177308-0d34-0410-b5e6-96231b3b80d8