Commit Graph

34 Commits

Author SHA1 Message Date
Fangrui Song ffe9f00cfe Fix file headers. NFC
llvm-svn: 355188
2019-03-01 09:52:53 +00:00
Chandler Carruth 2946cd7010 Update the file headers across all of the LLVM projects in the monorepo
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
2019-01-19 08:50:56 +00:00
Fangrui Song 41c249adc4 Add explicit dependency on clangSerialization after rC348911
llvm-svn: 348916
2018-12-12 08:25:16 +00:00
Stephen Kelly a49fe5d878 [clang-query] Add non-exclusive output API
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

llvm-svn: 345522
2018-10-29 18:59:56 +00:00
Stephen Kelly 70d771714e [clang-query] Refactor Output settings to booleans
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

llvm-svn: 345194
2018-10-24 20:33:55 +00:00
Stephen Kelly 51707b21a0 [clang-query] Add 'detailed-ast' output as an alias for 'dump'
Summary: Future development can then dump other content than AST.

Reviewers: aaron.ballman

Subscribers: cfe-commits

Differential Revision: https://reviews.llvm.org/D53500

llvm-svn: 345193
2018-10-24 20:33:45 +00:00
Stephen Kelly 4a5b01ddd7 [clang-query] Add option to print matcher expression
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

llvm-svn: 344840
2018-10-20 09:13:59 +00:00
Stephen Kelly 2c4079c090 [clang-query] Add comment token handling
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

llvm-svn: 343666
2018-10-03 08:21:54 +00:00
Stephen Kelly 42668a4d03 [clang-query] Add single-letter 'q' alias for 'quit'
Reviewers: aaron.ballman, pcc

Reviewed By: aaron.ballman

Subscribers: Szelethus, cfe-commits

Differential Revision: https://reviews.llvm.org/D52746

llvm-svn: 343664
2018-10-03 07:52:44 +00:00
Stephen Kelly 12ae3e678d Sort expected test output after previous commit
llvm-svn: 343538
2018-10-01 21:10:30 +00:00
Stephen Kelly c87e99f4a4 [clang-query] Test non-code-completion on single letter shortcuts
llvm-svn: 343536
2018-10-01 20:45:44 +00:00
Stephen Kelly 98a38f53e7 [clang-query] Add missing quit test
llvm-svn: 343535
2018-10-01 20:45:39 +00:00
Stephen Kelly 9af02f2028 [clang-query] Add missing 'l' command handling
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.

llvm-svn: 343533
2018-10-01 20:34:21 +00:00
Shuai Wang 02bfd89c93 Fix build failure caused by D52157
llvm-svn: 342408
2018-09-17 20:10:33 +00:00
Shoaib Meenai d806af3499 [CMake] Use PRIVATE in target_link_libraries for executables
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

llvm-svn: 319840
2017-12-05 21:49:56 +00:00
Chris Bieneman 2cc7fec76a Remove autoconf support
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

llvm-svn: 258864
2016-01-26 21:31:36 +00:00
Aaron Ballman 3abb97e4c6 Correcting and adding tests for r244206.
llvm-svn: 244208
2015-08-06 12:15:47 +00:00
Adrian Prantl 51540daec6 Add missing dependency clangFrontend to unit test.
llvm-svn: 240226
2015-06-20 19:21:04 +00:00
NAKAMURA Takumi 0c1e8452cc Add clangBasic to libdeps according to r232051 since the interface of ASTMatchers was changed.
llvm-svn: 232138
2015-03-13 03:47:43 +00:00
Adrian Prantl b97f5c1eb2 Revert "Adapt clang-tools-extra to clang module format changes."
This reverts commit 230424.

llvm-svn: 230456
2015-02-25 02:46:37 +00:00
Adrian Prantl e95edbf5a9 Adapt clang-tools-extra to clang module format changes.
- add clangCodeGen.a to the tools that need it
- tweak pp-trace command line handling to not conflict with clang's.

llvm-svn: 230424
2015-02-25 01:32:04 +00:00
Adrian Prantl a22fd38174 Revert "Adapt Makefile dependencies for the clang module format change in r230089."
llvm-svn: 230104
2015-02-21 00:29:43 +00:00
Adrian Prantl 6897e3e456 Adapt Makefile dependencies for the clang module format change in r230089.
llvm-svn: 230090
2015-02-20 23:35:07 +00:00
NAKAMURA Takumi 23b702c8de [CMake] Update libdeps.
llvm-svn: 212920
2014-07-14 05:01:53 +00:00
David Blaikie 25286a51b1 Remove unnecessary explicit unique_ptr ctors now that buildASTFromCode returns a unique_ptr instead of a raw pointer.
llvm-svn: 207238
2014-04-25 17:03:20 +00:00
David Blaikie 35013fa390 Slightly less blindly fixing clang-tools-extra now that I remember that the "check-clang" target doesn't check clang-tools-extra
llvm-svn: 207231
2014-04-25 15:21:43 +00:00
NAKAMURA Takumi d6aa8f435b QueryEngineTest.cpp: Appease g++47.
llvm-svn: 207097
2014-04-24 11:02:17 +00:00
NAKAMURA Takumi be6b63b685 ClangQueryTests: Fix msc17 build. Non-static member initializers are unavailable.
llvm-svn: 207096
2014-04-24 10:58:17 +00:00
Samuel Benzaquen 1f6066c9ac Add new 'let' command to bind arbitrary values into constants.
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

llvm-svn: 206984
2014-04-23 14:04:52 +00:00
Ahmed Charles 6a2dc5c381 [C++11] Replace OwningPtr with std::unique_ptr.
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.

llvm-svn: 203382
2014-03-09 09:24:40 +00:00
Chandler Carruth edc9e38810 [cleanup] Re-sort headers with llvm/utils/sort_includes.py.
llvm-svn: 202809
2014-03-04 10:03:05 +00:00
Peter Collingbourne d9a0f254bc Add completion to the query parser, and hook it up to clang-query.
Differential Revision: http://llvm-reviews.chandlerc.com/D2263

llvm-svn: 200604
2014-02-01 01:42:46 +00:00
NAKAMURA Takumi 78f534d689 [CMake] clang-tools-extra: Update dependencies.
llvm-svn: 196860
2013-12-10 01:41:10 +00:00
Peter Collingbourne 8b1265b353 Introduce clang-query tool.
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

llvm-svn: 194227
2013-11-08 00:08:23 +00:00