2017-05-26 20:26:51 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
support
|
2019-12-09 18:57:23 +08:00
|
|
|
AllTargetsInfos
|
2017-05-26 20:26:51 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
get_filename_component(CLANGD_SOURCE_DIR
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../../clangd REALPATH)
|
2019-04-11 01:25:14 +08:00
|
|
|
get_filename_component(CLANGD_BINARY_DIR
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/../../clangd REALPATH)
|
2017-05-26 20:26:51 +08:00
|
|
|
include_directories(
|
|
|
|
${CLANGD_SOURCE_DIR}
|
2019-04-11 01:25:14 +08:00
|
|
|
${CLANGD_BINARY_DIR}
|
2017-05-26 20:26:51 +08:00
|
|
|
)
|
|
|
|
|
[clangd] Move clangd tests to clangd directory. check-clangd is no longer part of check-clang-tools.
Summary:
Motivation:
- this layout is a pain to work with
- without a common root, it's painful to express things like "disable clangd" (D61122)
- CMake/lit configs are a maintenance hazard, and the more the one-off hacks
for various tools are entangled, the more we see apathy and non-ownership.
This attempts to use the bare-minimum configuration needed (while still
supporting the difficult cases: windows, standalone clang build, dynamic libs).
In particular the lit.cfg.py and lit.site.cfg.py.in are merged into lit.cfg.in.
The logic in these files is now minimal.
(Much of clang-tools-extra's lit configs can probably be cleaned up by reusing
lit.llvm.llvm_config.use_clang(), and every llvm project does its own version of
LDPATH mangling. I haven't attempted to fix any of those).
Docs are still in clang-tools-extra/docs, I don't have any plans to touch those.
Reviewers: gribozavr
Subscribers: mgorny, javed.absar, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits, ilya-biryukov, thakis
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61187
llvm-svn: 359424
2019-04-29 16:44:01 +08:00
|
|
|
if(CLANG_BUILT_STANDALONE)
|
|
|
|
# LLVMTestingSupport library is needed for clangd tests.
|
|
|
|
if (EXISTS ${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
|
|
|
|
AND NOT TARGET LLVMTestingSupport)
|
|
|
|
add_subdirectory(${LLVM_MAIN_SRC_DIR}/lib/Testing/Support
|
|
|
|
lib/Testing/Support)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
|
|
|
add_custom_target(ClangdUnitTests)
|
|
|
|
add_unittest(ClangdUnitTests ClangdTests
|
2017-12-21 00:06:05 +08:00
|
|
|
Annotations.cpp
|
2019-07-12 00:04:18 +08:00
|
|
|
ASTTests.cpp
|
[clangd] Minimal implementation of automatic static index (not enabled).
Summary:
See tinyurl.com/clangd-automatic-index for design and goals.
Lots of limitations to keep this patch smallish, TODOs everywhere:
- no serialization to disk
- no changes to dynamic index, which now has a much simpler job
- no partitioning of symbols by file to avoid duplication of header symbols
- no reindexing of edited files
- only a single worker thread
- compilation database is slurped synchronously (doesn't scale)
- uses memindex, rebuilds after every file (should be dex, periodically)
It's not hooked up to ClangdServer/ClangdLSPServer yet: the layering
isn't clear (it should really be in ClangdServer, but ClangdLSPServer
has all the CDB interactions).
Reviewers: ioeric
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, jfb, cfe-commits
Differential Revision: https://reviews.llvm.org/D53032
llvm-svn: 344513
2018-10-15 21:34:10 +08:00
|
|
|
BackgroundIndexTests.cpp
|
2018-08-24 21:09:41 +08:00
|
|
|
CancellationTests.cpp
|
2019-04-29 22:36:26 +08:00
|
|
|
CanonicalIncludesTests.cpp
|
2017-05-26 20:26:51 +08:00
|
|
|
ClangdTests.cpp
|
2017-12-05 15:20:26 +08:00
|
|
|
CodeCompleteTests.cpp
|
2017-12-21 01:24:31 +08:00
|
|
|
CodeCompletionStringsTests.cpp
|
2019-11-07 19:14:38 +08:00
|
|
|
CollectMacrosTests.cpp
|
[clangd] (take 2) Try harder to find a plausible `clang` as argv0, particularly on Mac.
Summary:
This was originally committed in 88bccded8fa169481fa367debf5ec615640635a1,
and reverted in 93f77617abba512d2861e2fc50ce385883f587b6.
This version is now much more testable: the "detect toolchain properties" part
is still not tested but also not active in tests.
All the command manipulation based on the detected properties is
directly tested, and also not active in other tests.
Fixes https://github.com/clangd/clangd/issues/211
Fixes https://github.com/clangd/clangd/issues/178
Reviewers: kbobyrev, ilya-biryukov
Subscribers: mgorny, ormris, cfe-commits, usaxena95, kadircet, arphaman, jkorous, MaskRay
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71029
2019-11-30 02:37:48 +08:00
|
|
|
CompileCommandsTests.cpp
|
2017-12-12 19:16:45 +08:00
|
|
|
ContextTests.cpp
|
2018-09-10 16:23:53 +08:00
|
|
|
DexTests.cpp
|
2019-01-28 22:01:55 +08:00
|
|
|
DiagnosticsTests.cpp
|
[clangd] Support incremental document syncing
Summary:
This patch adds support for incremental document syncing, as described
in the LSP spec. The protocol specifies ranges in terms of Position (a
line and a character), and our drafts are stored as plain strings. So I
see two things that may not be super efficient for very large files:
- Converting a Position to an offset (the positionToOffset function)
requires searching for end of lines until we reach the desired line.
- When we update a range, we construct a new string, which implies
copying the whole document.
However, for the typical size of a C++ document and the frequency of
update (at which a user types), it may not be an issue. This patch aims
at getting the basic feature in, and we can always improve it later if
we find it's too slow.
Signed-off-by: Simon Marchi <simon.marchi@ericsson.com>
Reviewers: malaperle, ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: MaskRay, klimek, mgorny, ilya-biryukov, jkorous-apple, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D44272
llvm-svn: 328500
2018-03-26 22:41:40 +08:00
|
|
|
DraftStoreTests.cpp
|
2018-11-26 23:25:20 +08:00
|
|
|
ExpectedTypeTest.cpp
|
2018-07-03 16:09:29 +08:00
|
|
|
FileDistanceTests.cpp
|
[clangd] Introduce Dex symbol index search tokens
This patch introduces the core building block of the next-generation
Clangd symbol index - Dex. Search tokens are the keys in the inverted
index and represent a characteristic of a specific symbol: examples of
search token types (Token Namespaces) are
* Trigrams - these are essential for unqualified symbol name fuzzy
search * Scopes for filtering the symbols by the namespace * Paths, e.g.
these can be used to uprank symbols defined close to the edited file
This patch outlines the generic for such token namespaces, but only
implements trigram generation.
The intuition behind trigram generation algorithm is that each extracted
trigram is a valid sequence for Fuzzy Matcher jumps, proposed
implementation utilize existing FuzzyMatcher API for segmentation and
trigram extraction.
However, trigrams generation algorithm for the query string is different
from the previous one: it simply yields sequences of 3 consecutive
lowercased valid characters (letters, digits).
Dex RFC in the mailing list:
http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html
The trigram generation techniques are described in detail in the
proposal:
https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj
Reviewers: sammccall, ioeric, ilya-biryukovA
Subscribers: cfe-commits, klimek, mgorny, MaskRay, jkorous, arphaman
Differential Revision: https://reviews.llvm.org/D49591
llvm-svn: 337901
2018-07-25 18:34:57 +08:00
|
|
|
FileIndexTests.cpp
|
[clangd] Implementation of workspace/symbol request
Summary:
This is a basic implementation of the "workspace/symbol" request which is
used to find symbols by a string query. Since this is similar to code completion
in terms of result, this implementation reuses the "fuzzyFind" in order to get
matches. For now, the scoring algorithm is the same as code completion and
improvements could be done in the future.
The index model doesn't contain quite enough symbols for this to cover
common symbols like methods, enum class enumerators, functions in unamed
namespaces, etc. The index model will be augmented separately to achieve this.
Reviewers: sammccall, ilya-biryukov
Reviewed By: sammccall
Subscribers: jkorous, hokein, simark, sammccall, klimek, mgorny, ilya-biryukov, mgrang, jkorous-apple, ioeric, MaskRay, cfe-commits
Differential Revision: https://reviews.llvm.org/D44882
llvm-svn: 330637
2018-04-24 04:00:52 +08:00
|
|
|
FindSymbolsTests.cpp
|
[clangd] Add targetDecl(), which determines what declaration an AST node refers to.
Summary:
This is the first part of an effort to "unbundle" our libIndex use into separate
concerns (AST traversal, token<->node mapping, node<->decl mapping,
decl<->decl relationshipes).
Currently, clangd relies on libIndex to associate tokens, AST nodes, and decls.
This leads to rather convoluted implementations of e.g. hover and
extract-function, which are not naturally thought of as indexing applications.
The idea is that by decoupling different concerns, we make them easier
to use, test, and combine, and more efficient when only one part is needed.
There are some synergies between e.g. traversal and finding
relationships between decls, hopefully the benefits outweight these.
Reviewers: kadircet, ilya-biryukov
Subscribers: mgorny, MaskRay, jkorous, arphaman, jfb, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D66751
llvm-svn: 370746
2019-09-03 19:35:50 +08:00
|
|
|
FindTargetTests.cpp
|
2019-05-07 22:18:18 +08:00
|
|
|
FormattedStringTests.cpp
|
[clangd] Revamp textDocument/onTypeFormatting.
Summary:
The existing implementation (which triggers on }) is fairly simple and
has flaws:
- doesn't trigger frequently/regularly enough (particularly in editors that type the }
for you)
- often reformats too much code around the edit
- has jarring cases that I don't have clear ideas for fixing
This implementation is designed to trigger on newline, which feels to me more
intuitive than } or ;.
It does have allow for reformatting after other characters - it has a
basic behavior and a model for adding specialized behavior for
particular characters. But at least initially I'd stick to advertising
\n in the capabilities.
This also handles comment splitting: when you insert a line break inside
a line comment, it will make the new line into an aligned line comment.
Working on tests, but want people to patch it in and try it - it's hard to
see if "feel" is right purely by looking at a test.
Reviewers: ilya-biryukov, hokein
Subscribers: mgorny, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D60605
llvm-svn: 362939
2019-06-10 22:26:21 +08:00
|
|
|
FormatTests.cpp
|
2018-10-02 18:43:55 +08:00
|
|
|
FSTests.cpp
|
2018-11-20 18:56:03 +08:00
|
|
|
FunctionTests.cpp
|
2017-12-02 01:08:02 +08:00
|
|
|
FuzzyMatchTests.cpp
|
2018-04-20 19:35:17 +08:00
|
|
|
GlobalCompilationDatabaseTests.cpp
|
2018-02-16 22:15:55 +08:00
|
|
|
HeadersTests.cpp
|
2019-09-25 18:30:22 +08:00
|
|
|
HeaderSourceSwitchTests.cpp
|
[clangd] Untangle Hover from XRefs, move into own file.
Summary:
This is mostly mechanical, with a few exceptions:
- getDeducedType moved into AST.h where it belongs. It now takes
ASTContext instead of ParsedAST, and avoids using the preprocessor.
- hover now uses SelectionTree directly rather than via
getDeclAtPosition helper
- hover on 'auto' used to find the decl that contained the 'auto' and
use that to set Kind and documentation for the hover result.
Now we use targetDecl() to find the decl matching the deduced type instead.
This changes tests, e.g. 'variable' -> class for auto on lambdas.
I think this is better, but the motivation was to avoid depending on
the internals of DeducedTypeVisitor. This functionality is removed
from the visitor.
Reviewers: kadircet
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70357
2019-11-17 00:00:19 +08:00
|
|
|
HoverTests.cpp
|
2018-12-01 00:59:00 +08:00
|
|
|
IndexActionTests.cpp
|
2017-12-14 19:25:49 +08:00
|
|
|
IndexTests.cpp
|
[clangd] Refactor JSON-over-stdin/stdout code into Transport abstraction. (re-land r344620)
Summary:
This paves the way for alternative transports (mac XPC, maybe messagepack?),
and also generally improves layering: testing ClangdLSPServer becomes less of
a pipe dream, we split up the JSONOutput monolith, etc.
This isn't a final state, much of what remains in JSONRPCDispatcher can go away,
handlers can call reply() on the transport directly, JSONOutput can be renamed
to StreamLogger and removed, etc. But this patch is sprawling already.
The main observable change (see tests) is that hitting EOF on input is now an
error: the client should send the 'exit' notification.
This is defensible: the protocol doesn't spell this case out. Reproducing the
current behavior for all combinations of shutdown/exit/EOF clutters interfaces.
We can iterate on this if desired.
Reviewers: jkorous, ioeric, hokein
Subscribers: mgorny, ilya-biryukov, MaskRay, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D53286
llvm-svn: 344672
2018-10-17 15:32:05 +08:00
|
|
|
JSONTransportTests.cpp
|
2019-09-04 17:46:06 +08:00
|
|
|
ParsedASTTests.cpp
|
2020-01-07 18:28:05 +08:00
|
|
|
PathMappingTests.cpp
|
2019-04-15 15:21:17 +08:00
|
|
|
PrintASTTests.cpp
|
[clangd] Extract scoring/ranking logic, and shave yaks.
Summary:
Code completion scoring was embedded in CodeComplete.cpp, which is bad:
- awkward to test. The mechanisms (extracting info from index/sema) can be
unit-tested well, the policy (scoring) should be quantitatively measured.
Neither was easily possible, and debugging was hard.
The intermediate signal struct makes this easier.
- hard to reuse. This is a bug in workspaceSymbols: it just presents the
results in the index order, which is not sorted in practice, it needs to rank
them!
Also, index implementations care about scoring (both query-dependent and
independent) in order to truncate result lists appropriately.
The main yak shaved here is the build() function that had 3 variants across
unit tests is unified in TestTU.h (rather than adding a 4th variant).
Reviewers: ilya-biryukov
Subscribers: klimek, mgorny, ioeric, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46524
llvm-svn: 332378
2018-05-16 01:43:27 +08:00
|
|
|
QualityTests.cpp
|
2019-05-07 15:11:56 +08:00
|
|
|
RenameTests.cpp
|
[clangd] Define a compact binary serialization fomat for symbol slab/index.
Summary:
This is intended to replace the current YAML format for general use.
It's ~10x more compact than YAML, and ~40% more compact than gzipped YAML:
llvmidx.riff = 20M, llvmidx.yaml = 272M, llvmidx.yaml.gz = 32M
It's also simpler/faster to read and write.
The format is a RIFF container (chunks of (type, size, data)) with:
- a compressed string table
- simple binary encoding of symbols (with varints for compactness)
It can be extended to include occurrences, Dex posting lists, etc.
There's no rich backwards-compatibility scheme, but a version number is included
so we can detect incompatible files and do ad-hoc back-compat.
Alternatives considered:
- compressed YAML or JSON: bulky and slow to load
- llvm bitstream: confusing model and libraries are hard to use. My attempt
produced slightly larger files, and the code was longer and slower.
- protobuf or similar: would be really nice (esp for back-compat) but the
dependency is a big hassle
- ad-hoc binary format without a container: it seems clear we're going
to add posting lists and occurrences here, and that they will benefit
from sharing a string table. The container makes it easy to debug
these pieces in isolation, and make them optional.
Reviewers: ioeric
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D51585
llvm-svn: 341375
2018-09-05 00:16:50 +08:00
|
|
|
RIFFTests.cpp
|
[clangd] Lib to compute and represent selection under cursor.
Summary:
The primary problem this solves is to expose the codeAction selection to
AST-based refactorings in a way that makes it easy and efficient for them to
bind to the right parts of the AST.
It should also allow us to make XRefs based features (textDocument/definition)
more robust, more easily implement textDocument/typeDefinition etc.
As an example, template parameter references can be identified without special
handling.
There should be slight speedup too: we can prune most of the AST traversal
in most cases.
Elephant in the room: this is similar-but-different to Tooling/Refactoring/ASTSelection.
That captures a smaller set of AST nodes, has a slightly different way of
representing selections, and generally has mare features and does more work.
The overall shape is pretty similar, and yet I can't quite get to behave as I
expect.
Reviewers: ilya-biryukov, kadircet
Subscribers: mgorny, ioeric, MaskRay, jkorous, mgrang, arphaman
Tags: #clang
Differential Revision: https://reviews.llvm.org/D57562
llvm-svn: 352874
2019-02-01 23:05:11 +08:00
|
|
|
SelectionTests.cpp
|
2019-06-26 21:08:36 +08:00
|
|
|
SemanticHighlightingTests.cpp
|
2019-09-16 19:29:35 +08:00
|
|
|
SemanticSelectionTests.cpp
|
[clangd] Define a compact binary serialization fomat for symbol slab/index.
Summary:
This is intended to replace the current YAML format for general use.
It's ~10x more compact than YAML, and ~40% more compact than gzipped YAML:
llvmidx.riff = 20M, llvmidx.yaml = 272M, llvmidx.yaml.gz = 32M
It's also simpler/faster to read and write.
The format is a RIFF container (chunks of (type, size, data)) with:
- a compressed string table
- simple binary encoding of symbols (with varints for compactness)
It can be extended to include occurrences, Dex posting lists, etc.
There's no rich backwards-compatibility scheme, but a version number is included
so we can detect incompatible files and do ad-hoc back-compat.
Alternatives considered:
- compressed YAML or JSON: bulky and slow to load
- llvm bitstream: confusing model and libraries are hard to use. My attempt
produced slightly larger files, and the code was longer and slower.
- protobuf or similar: would be really nice (esp for back-compat) but the
dependency is a big hassle
- ad-hoc binary format without a container: it seems clear we're going
to add posting lists and occurrences here, and that they will benefit
from sharing a string table. The container makes it easy to debug
these pieces in isolation, and make them optional.
Reviewers: ioeric
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D51585
llvm-svn: 341375
2018-09-05 00:16:50 +08:00
|
|
|
SerializationTests.cpp
|
2018-02-12 19:37:28 +08:00
|
|
|
SourceCodeTests.cpp
|
|
|
|
SymbolCollectorTests.cpp
|
2018-11-28 00:40:46 +08:00
|
|
|
SymbolInfoTests.cpp
|
2018-02-12 19:37:28 +08:00
|
|
|
SyncAPI.cpp
|
[clangd] Introduce Dex symbol index search tokens
This patch introduces the core building block of the next-generation
Clangd symbol index - Dex. Search tokens are the keys in the inverted
index and represent a characteristic of a specific symbol: examples of
search token types (Token Namespaces) are
* Trigrams - these are essential for unqualified symbol name fuzzy
search * Scopes for filtering the symbols by the namespace * Paths, e.g.
these can be used to uprank symbols defined close to the edited file
This patch outlines the generic for such token namespaces, but only
implements trigram generation.
The intuition behind trigram generation algorithm is that each extracted
trigram is a valid sequence for Fuzzy Matcher jumps, proposed
implementation utilize existing FuzzyMatcher API for segmentation and
trigram extraction.
However, trigrams generation algorithm for the query string is different
from the previous one: it simply yields sequences of 3 consecutive
lowercased valid characters (letters, digits).
Dex RFC in the mailing list:
http://lists.llvm.org/pipermail/clangd-dev/2018-July/000022.html
The trigram generation techniques are described in detail in the
proposal:
https://docs.google.com/document/d/1C-A6PGT6TynyaX4PXyExNMiGmJ2jL1UwV91Kyx11gOI/edit#heading=h.903u1zon9nkj
Reviewers: sammccall, ioeric, ilya-biryukovA
Subscribers: cfe-commits, klimek, mgorny, MaskRay, jkorous, arphaman
Differential Revision: https://reviews.llvm.org/D49591
llvm-svn: 337901
2018-07-25 18:34:57 +08:00
|
|
|
TUSchedulerTests.cpp
|
2017-12-05 15:20:26 +08:00
|
|
|
TestFS.cpp
|
2018-08-20 22:39:32 +08:00
|
|
|
TestIndex.cpp
|
[clangd] Extract scoring/ranking logic, and shave yaks.
Summary:
Code completion scoring was embedded in CodeComplete.cpp, which is bad:
- awkward to test. The mechanisms (extracting info from index/sema) can be
unit-tested well, the policy (scoring) should be quantitatively measured.
Neither was easily possible, and debugging was hard.
The intermediate signal struct makes this easier.
- hard to reuse. This is a bug in workspaceSymbols: it just presents the
results in the index order, which is not sorted in practice, it needs to rank
them!
Also, index implementations care about scoring (both query-dependent and
independent) in order to truncate result lists appropriately.
The main yak shaved here is the build() function that had 3 variants across
unit tests is unified in TestTU.h (rather than adding a 4th variant).
Reviewers: ilya-biryukov
Subscribers: klimek, mgorny, ioeric, MaskRay, jkorous, mgrang, cfe-commits
Differential Revision: https://reviews.llvm.org/D46524
llvm-svn: 332378
2018-05-16 01:43:27 +08:00
|
|
|
TestTU.cpp
|
2018-02-08 15:37:35 +08:00
|
|
|
ThreadingTests.cpp
|
2017-11-02 17:21:51 +08:00
|
|
|
TraceTests.cpp
|
[clangd] Add support for type hierarchy (super types only for now)
Summary:
Patch by Nathan Ridge(@nridge)!
This is an LSP extension proposed here:
https://github.com/Microsoft/vscode-languageserver-node/pull/426
An example client implementation can be found here:
https://github.com/theia-ide/theia/pull/3802
Reviewers: kadircet, sammccall
Reviewed By: kadircet
Subscribers: jdoerfert, sammccall, cfe-commits, mgorny, dschaefer, simark, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet
Tags: #clang
Differential Revision: https://reviews.llvm.org/D56370
llvm-svn: 356445
2019-03-19 17:27:04 +08:00
|
|
|
TypeHierarchyTests.cpp
|
2019-02-01 05:30:05 +08:00
|
|
|
TweakTests.cpp
|
2019-08-02 17:12:39 +08:00
|
|
|
TweakTesting.cpp
|
2018-02-12 19:37:28 +08:00
|
|
|
URITests.cpp
|
2017-12-21 00:06:05 +08:00
|
|
|
XRefsTests.cpp
|
2019-02-01 05:30:05 +08:00
|
|
|
|
|
|
|
$<TARGET_OBJECTS:obj.clangDaemonTweaks>
|
2017-05-26 20:26:51 +08:00
|
|
|
)
|
|
|
|
|
2019-10-05 04:30:02 +08:00
|
|
|
clang_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
|
2018-05-16 16:53:57 +08:00
|
|
|
clangAST
|
2017-05-26 20:26:51 +08:00
|
|
|
clangBasic
|
|
|
|
clangFormat
|
|
|
|
clangFrontend
|
2017-12-14 17:20:21 +08:00
|
|
|
clangIndex
|
2018-02-18 18:50:16 +08:00
|
|
|
clangLex
|
2017-05-26 20:26:51 +08:00
|
|
|
clangSema
|
2018-12-12 16:25:16 +08:00
|
|
|
clangSerialization
|
2017-05-26 20:26:51 +08:00
|
|
|
clangTooling
|
|
|
|
clangToolingCore
|
2018-06-04 20:04:51 +08:00
|
|
|
clangToolingInclusions
|
2019-08-29 07:17:38 +08:00
|
|
|
clangToolingRefactoring
|
2019-06-19 22:03:19 +08:00
|
|
|
clangToolingSyntax
|
2019-10-05 04:30:02 +08:00
|
|
|
)
|
|
|
|
target_link_libraries(ClangdTests
|
|
|
|
PRIVATE
|
|
|
|
clangDaemon
|
|
|
|
clangTidy
|
2017-05-26 20:26:51 +08:00
|
|
|
LLVMSupport
|
Make positionToOffset return llvm::Expected<size_t>
Summary:
To implement incremental document syncing, we want to verify that the
ranges provided by the front-end are valid. Currently, positionToOffset
deals with invalid Positions by returning 0 or Code.size(), which are
two valid offsets. Instead, return an llvm:Expected<size_t> with an
error if the position is invalid.
According to the LSP, if the character value exceeds the number of
characters of the given line, it should default back to the end of the
line. It makes sense in some contexts to have this behavior, and does
not in other contexts. The AllowColumnsBeyondLineLength parameter
allows to decide what to do in that case, default back to the end of the
line, or return an error.
Reviewers: ilya-biryukov
Subscribers: klimek, ilya-biryukov, jkorous-apple, ioeric, cfe-commits
Differential Revision: https://reviews.llvm.org/D44673
llvm-svn: 328100
2018-03-21 22:36:46 +08:00
|
|
|
LLVMTestingSupport
|
2017-05-26 20:26:51 +08:00
|
|
|
)
|
2019-01-16 08:24:22 +08:00
|
|
|
|
|
|
|
if (CLANGD_BUILD_XPC)
|
|
|
|
add_subdirectory(xpc)
|
|
|
|
endif ()
|
2019-04-29 19:47:52 +08:00
|
|
|
|
|
|
|
configure_lit_site_cfg(
|
2019-05-02 16:00:39 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.py.in
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg.py)
|