2017-05-26 20:26:51 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
support
|
|
|
|
)
|
|
|
|
|
|
|
|
get_filename_component(CLANGD_SOURCE_DIR
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../clangd REALPATH)
|
|
|
|
include_directories(
|
|
|
|
${CLANGD_SOURCE_DIR}
|
|
|
|
)
|
|
|
|
|
|
|
|
add_extra_unittest(ClangdTests
|
2017-12-21 00:06:05 +08:00
|
|
|
Annotations.cpp
|
2017-05-26 20:26:51 +08:00
|
|
|
ClangdTests.cpp
|
2018-01-26 01:29:17 +08:00
|
|
|
ClangdUnitTests.cpp
|
2017-12-05 15:20:26 +08:00
|
|
|
CodeCompleteTests.cpp
|
2017-12-21 01:24:31 +08:00
|
|
|
CodeCompletionStringsTests.cpp
|
2017-12-12 19:16:45 +08:00
|
|
|
ContextTests.cpp
|
2017-12-15 20:25:02 +08:00
|
|
|
FileIndexTests.cpp
|
2017-12-02 01:08:02 +08:00
|
|
|
FuzzyMatchTests.cpp
|
2017-12-14 19:25:49 +08:00
|
|
|
IndexTests.cpp
|
Adds a json::Expr type to represent intermediate JSON expressions.
Summary:
This form can be created with a nice clang-format-friendly literal syntax,
and gets escaping right. It knows how to call unparse() on our Protocol types.
All the places where we pass around JSON internally now use this type.
Object properties are sorted (stored as std::map) and so serialization is
canonicalized, with optional prettyprinting (triggered by a -pretty flag).
This makes the lit tests much nicer to read and somewhat nicer to debug.
(Unfortunately the completion tests use CHECK-DAG, which only has
line-granularity, so pretty-printing is disabled there. In future we
could make completion ordering deterministic, or switch to unittests).
Compared to the current approach, it has some efficiencies like avoiding copies
of string literals used as object keys, but is probably slower overall.
I think the code/test quality benefits are worth it.
This patch doesn't attempt to do anything about JSON *parsing*.
It takes direction from the proposal in this doc[1], but is limited in scope
and visibility, for now.
I am of half a mind just to use Expr as the target of a parser, and maybe do a
little string deduplication, but not bother with clever memory allocation.
That would be simple, and fast enough for clangd...
[1] https://docs.google.com/document/d/1OEF9IauWwNuSigZzvvbjc1cVS1uGHRyGTXaoy3DjqM4/edit
+cc d0k so he can tell me not to use std::map.
Reviewers: ioeric, malaperle
Subscribers: bkramer, ilya-biryukov, mgorny, klimek
Differential Revision: https://reviews.llvm.org/D39435
llvm-svn: 317486
2017-11-06 23:40:30 +08:00
|
|
|
JSONExprTests.cpp
|
2018-01-22 19:48:20 +08:00
|
|
|
URITests.cpp
|
2017-12-05 15:20:26 +08:00
|
|
|
TestFS.cpp
|
2018-02-08 15:37:35 +08:00
|
|
|
ThreadingTests.cpp
|
2017-11-02 17:21:51 +08:00
|
|
|
TraceTests.cpp
|
2018-01-31 16:51:16 +08:00
|
|
|
TUSchedulerTests.cpp
|
2017-12-19 20:23:48 +08:00
|
|
|
SourceCodeTests.cpp
|
[clangd] Introduce a "Symbol" class.
Summary:
* The "Symbol" class represents a C++ symbol in the codebase, containing all the
information of a C++ symbol needed by clangd. clangd will use it in clangd's
AST/dynamic index and global/static index (code completion and code
navigation).
* The SymbolCollector (another IndexAction) will be used to recollect the
symbols when the source file is changed (for ASTIndex), or to generate
all C++ symbols for the whole project.
In the long term (when index-while-building is ready), clangd should share a
same "Symbol" structure and IndexAction with index-while-building, but
for now we want to have some stuff working in clangd.
Reviewers: ioeric, sammccall, ilya-biryukov, malaperle
Reviewed By: sammccall
Subscribers: malaperle, klimek, mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D40897
llvm-svn: 320486
2017-12-12 23:42:10 +08:00
|
|
|
SymbolCollectorTests.cpp
|
2017-12-21 00:06:05 +08:00
|
|
|
XRefsTests.cpp
|
2017-05-26 20:26:51 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(ClangdTests
|
[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-06 05:49:56 +08:00
|
|
|
PRIVATE
|
2017-05-26 20:26:51 +08:00
|
|
|
clangBasic
|
|
|
|
clangDaemon
|
|
|
|
clangFormat
|
|
|
|
clangFrontend
|
2017-12-14 17:20:21 +08:00
|
|
|
clangIndex
|
2017-05-26 20:26:51 +08:00
|
|
|
clangSema
|
|
|
|
clangTooling
|
|
|
|
clangToolingCore
|
|
|
|
LLVMSupport
|
|
|
|
)
|