aboutsummaryrefslogtreecommitdiff
path: root/clang-query
AgeCommit message (Collapse)Author
2019-01-10Remove unnecessary include.Richard Trieu
QuerySession.h does not need anything from Query.h, so it does not need to include it. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@350797 91177308-0d34-0410-b5e6-96231b3b80d8
2019-01-08[Query] NFC: Port QueryParser to StringRefStephen Kelly
Summary: There is no reason for it to not be a StringRef. Making it one simplifies existing code, and makes follow-up features easier. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D56415 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@350660 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-12Add explicit dependency on clangSerialization after rC348911Fangrui Song
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@348916 91177308-0d34-0410-b5e6-96231b3b80d8
2018-12-05[clang-query] Continue if compilation command not found for some filesGeorge Karpenkov
When searching for a code pattern in an entire project with a compilation database it's tempting to run ``` clang-query **.cpp ``` And yet, that often breaks because some files are just not in the compilation database: tests, sample code, etc.. clang-query should not stop when encountering such cases. Differential Revision: https://reviews.llvm.org/D51183 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@348328 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-29[clang-query] Add non-exclusive output APIStephen Kelly
Summary: Add granular options for AST dumping, text printing and diagnostics. This makes it possible to * Have both diag and dump active at once * Extend the output with other queryable content in the future. Reviewers: aaron.ballman, pcc, ioeric, ilya-biryukov, klimek, sammccall Reviewed By: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52857 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345522 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-24[clang-query] Refactor Output settings to booleansStephen Kelly
Summary: This will make it possible to add non-exclusive mode output. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53501 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345194 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-24[clang-query] Add 'detailed-ast' output as an alias for 'dump'Stephen Kelly
Summary: Future development can then dump other content than AST. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53500 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345193 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-24[clang-query] Re-word command helpStephen Kelly
Summary: This will make it possible to easily * Add new commands which accept <feature> parameters * Extend the list of features Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53498 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@345192 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-20[clang-query] Add option to print matcher expressionStephen Kelly
Summary: This is useful if using clang-query -f with a file containing multiple matchers. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D52859 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@344840 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-03[clang-query] Add comment token handlingStephen Kelly
Summary: It is possible to pass a file of commands to clang-query using the command line option -f or --preload. Make it possible to write comments in such files. Reviewers: aaron.ballman Reviewed By: aaron.ballman Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D52752 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343666 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-03[clang-query] Add single-letter 'q' alias for 'quit'Stephen Kelly
Reviewers: aaron.ballman, pcc Reviewed By: aaron.ballman Subscribers: Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D52746 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343664 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01[clang-query] Add missing 'l' command handlingStephen Kelly
The `let` command was added in commit 045c15ba (Add new 'let' command to bind arbitrary values into constants., 2014-04-23). The `let` command and the non-existant `l` command were documented in commit 233092a0 (Add 'let' to the help message., 2015-02-27). Implement the `l` command now for completeness. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343533 91177308-0d34-0410-b5e6-96231b3b80d8
2018-10-01[clang-query] Sort command optionsStephen Kelly
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@343532 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30Add preload option to clang-queryStephen Kelly
Summary: This allows loading a file with pre-defined let commands for example. Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51261 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@341145 91177308-0d34-0410-b5e6-96231b3b80d8
2018-08-30Extract runCommandsInFile methodStephen Kelly
Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D51260 git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@341144 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-26Fix for LLVM r326109David Zarzycki
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@326118 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05[CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai
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
2017-06-27[NFC] Update to account for DiagnosticRenderer use of FullSourceLocPeter Smith
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
2016-12-14modernize-use-auto NFC fixesPiotr Padlewski
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@289656 91177308-0d34-0410-b5e6-96231b3b80d8
2016-11-08[clang-tools-extra] Format sources with clang-format. NFC.Mandeep Singh Grang
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
2016-11-01[clang-query] Fix Clang-tidy readability-redundant-string-cstr warningsMalcolm Parsons
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
2016-06-09Update to match LLVM r272232.Richard Smith
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@272235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-17Fix Clang-tidy modernize-deprecated-headers warnings; other minor fixes.Eugene Zelenko
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
2016-01-26Remove autoconf supportChris Bieneman
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
2015-10-20Revert "Apply modernize-use-default to clang-tools-extra."David Blaikie
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
2015-10-20Apply modernize-use-default to clang-tools-extra.Angel Garcia Gomez
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
2015-09-28Install clang-query by default.Manuel Klimek
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
2015-08-06Add the "quit" command as a way to terminate clang-query interactive sessions.Aaron Ballman
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@244206 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-20Add missing dependency clangFrontend to clangQuery.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@240227 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-11Use 'override/final' instead of 'virtual' for overridden methodsAlexander Kornienko
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
2015-02-27Add 'let' to the help message.Samuel Benzaquen
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
2015-02-25Revert "Adapt clang-tools-extra to clang module format changes."Adrian Prantl
This reverts commit 230424. git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230456 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-25Adapt clang-tools-extra to clang module format changes.Adrian Prantl
- 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
2015-02-21Revert "Adapt Makefile dependencies for the clang module format change in ↵Adrian Prantl
r230089." git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230104 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-20Adapt Makefile dependencies for the clang module format change in r230089.Adrian Prantl
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@230090 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-29Remove call to llvm::makeArrayRef. Implicit conversion is sufficient.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@216711 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-27Simplify creation of a couple ArrayRefs by using None and makeArrayRef.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@216529 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-12[clang-query] Use the new API for named values from the Parser.Samuel Benzaquen
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
2014-08-02Use CommonOptionsParser in clang-query. This fixes its support of the fixedAlexander Kornienko
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
2014-07-16Track clang r213171Alp Toker
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
2014-07-15Prune Redundant libdeps in CMake's target_link_libraries and LLVMBuild.txt.NAKAMURA Takumi
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
2014-07-14[CMake] Update libdeps.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@212920 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-10Simplify code. No functional change.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210508 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-09[C++11] Use 'nullptr'.Craig Topper
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@210447 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-21Fix clang-query on Windows: flush llvm::outs() after each command.Manuel Klimek
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@209313 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-25Slightly less blindly fixing clang-tools-extra now that I remember that the ↵David Blaikie
"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
2014-04-25Blindly try to fix the clang-tools-extra build since my local build doesn't ↵David Blaikie
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
2014-04-23QueryParser::doParse(): Fix msc17 build. Don't use initializer list.NAKAMURA Takumi
git-svn-id: https://llvm.org/svn/llvm-project/clang-tools-extra/trunk@206998 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-23Add new 'let' command to bind arbitrary values into constants.Samuel Benzaquen
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
2014-03-09[C++11] Replace OwningPtr with std::unique_ptr.Ahmed Charles
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