2012-08-10 01:17:01 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
2015-10-06 18:45:03 +08:00
|
|
|
${LLVM_TARGETS_TO_BUILD}
|
2020-04-08 00:26:40 +08:00
|
|
|
FrontendOpenMP
|
2013-12-10 20:40:37 +08:00
|
|
|
Support
|
2012-08-10 01:17:01 +08:00
|
|
|
)
|
|
|
|
|
2016-03-09 00:34:37 +08:00
|
|
|
# By default MSVC has a 2^16 limit on the number of sections in an object file,
|
|
|
|
# and this needs more than that.
|
|
|
|
if (MSVC)
|
2016-11-02 22:31:36 +08:00
|
|
|
set_source_files_properties(RecursiveASTVisitorTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
|
2016-03-09 00:34:37 +08:00
|
|
|
set_source_files_properties(RecursiveASTVisitorTestExprVisitor.cpp PROPERTIES COMPILE_FLAGS /bigobj)
|
2020-06-29 23:01:58 +08:00
|
|
|
set_source_files_properties(RecursiveASTVisitorTests/Callbacks.cpp PROPERTIES COMPILE_FLAGS /bigobj)
|
2020-02-28 06:33:24 +08:00
|
|
|
set_source_files_properties(SourceCodeTest.cpp PROPERTIES COMPILE_FLAGS /bigobj)
|
2016-03-09 00:34:37 +08:00
|
|
|
endif()
|
|
|
|
|
2012-06-21 17:51:42 +08:00
|
|
|
add_clang_unittest(ToolingTests
|
2017-08-24 21:51:09 +08:00
|
|
|
ASTSelectionTest.cpp
|
2017-06-27 16:19:09 +08:00
|
|
|
CastExprTest.cpp
|
2012-06-25 07:56:26 +08:00
|
|
|
CommentHandlerTest.cpp
|
2012-06-21 17:51:42 +08:00
|
|
|
CompilationDatabaseTest.cpp
|
Introduce FileEntryRef and use it when handling includes to report correct dependencies
when the FileManager is reused across invocations
This commit introduces a parallel API to FileManager's getFile: getFileEntryRef, which returns
a reference to the FileEntry, and the name that was used to access the file. In the case of
a VFS with 'use-external-names', the FileEntyRef contains the external name of the file,
not the filename that was used to access it.
The new API is adopted only in the HeaderSearch and Preprocessor for include file lookup, so that the
accessed path can be propagated to SourceManager's FileInfo. SourceManager's FileInfo now can report this accessed path, using
the new getName method. This API is then adopted in the dependency collector, which now correctly reports dependencies when a file
is included both using a symlink and a real path in the case when the FileManager is reused across multiple Preprocessor invocations.
Note that this patch does not fix all dependency collector issues, as the same problem is still present in other cases when dependencies
are obtained using FileSkipped, InclusionDirective, and HasInclude. This will be fixed in follow-up commits.
Differential Revision: https://reviews.llvm.org/D65907
llvm-svn: 369680
2019-08-23 02:15:50 +08:00
|
|
|
DependencyScannerTest.cpp
|
[Clang-Tidy] Preserve Message, FileOffset, FilePath in Clang-Tidy YAML output
Summary:
To get properly integration Clang-Tidy with CLion IDE, next things were implemented:
1) Preserve `Message`, `FileOffset`, `FilePath` in the clang-tidy output.
2) Export all diagnostics, not just the ones with fixes
3) Test-cases
Reviewers: klimek, ilya-biryukov, alexfh
Reviewed By: alexfh
Subscribers: alexfh, JDevlieghere, mgorny, xazax.hun, cfe-commits, klimek
Tags: #clang-tools-extra
Patch by Vladimir Plyashkun!
Differential Revision: https://reviews.llvm.org/D34404
llvm-svn: 308014
2017-07-14 18:37:44 +08:00
|
|
|
DiagnosticsYamlTest.cpp
|
2017-10-26 18:38:14 +08:00
|
|
|
ExecutionTest.cpp
|
2017-03-01 21:14:01 +08:00
|
|
|
FixItTest.cpp
|
2018-05-15 04:17:53 +08:00
|
|
|
HeaderIncludesTest.cpp
|
2017-08-24 21:51:09 +08:00
|
|
|
LexicallyOrderedRecursiveASTVisitorTest.cpp
|
2015-10-22 23:04:10 +08:00
|
|
|
LookupTest.cpp
|
2016-05-11 22:31:39 +08:00
|
|
|
QualTypeNamesTest.cpp
|
2019-05-20 21:15:14 +08:00
|
|
|
RangeSelectorTest.cpp
|
2018-04-20 02:19:02 +08:00
|
|
|
RecursiveASTVisitorTests/Attr.cpp
|
2020-06-29 18:21:14 +08:00
|
|
|
RecursiveASTVisitorTests/Callbacks.cpp
|
2018-04-20 02:19:02 +08:00
|
|
|
RecursiveASTVisitorTests/Class.cpp
|
|
|
|
RecursiveASTVisitorTests/ConstructExpr.cpp
|
|
|
|
RecursiveASTVisitorTests/CXXBoolLiteralExpr.cpp
|
|
|
|
RecursiveASTVisitorTests/CXXMemberCall.cpp
|
2019-08-09 15:30:28 +08:00
|
|
|
RecursiveASTVisitorTests/CXXMethodDecl.cpp
|
2018-04-20 02:19:02 +08:00
|
|
|
RecursiveASTVisitorTests/CXXOperatorCallExprTraverser.cpp
|
|
|
|
RecursiveASTVisitorTests/DeclRefExpr.cpp
|
|
|
|
RecursiveASTVisitorTests/ImplicitCtor.cpp
|
2019-08-05 20:20:43 +08:00
|
|
|
RecursiveASTVisitorTests/ImplicitCtorInitializer.cpp
|
2018-04-20 02:19:02 +08:00
|
|
|
RecursiveASTVisitorTests/InitListExprPostOrder.cpp
|
|
|
|
RecursiveASTVisitorTests/InitListExprPostOrderNoQueue.cpp
|
|
|
|
RecursiveASTVisitorTests/InitListExprPreOrder.cpp
|
|
|
|
RecursiveASTVisitorTests/InitListExprPreOrderNoQueue.cpp
|
|
|
|
RecursiveASTVisitorTests/IntegerLiteral.cpp
|
|
|
|
RecursiveASTVisitorTests/LambdaDefaultCapture.cpp
|
|
|
|
RecursiveASTVisitorTests/LambdaExpr.cpp
|
2019-06-20 01:43:58 +08:00
|
|
|
RecursiveASTVisitorTests/LambdaTemplateParams.cpp
|
2019-12-07 04:43:02 +08:00
|
|
|
RecursiveASTVisitorTests/MemberPointerTypeLoc.cpp
|
2018-04-20 02:19:02 +08:00
|
|
|
RecursiveASTVisitorTests/NestedNameSpecifiers.cpp
|
|
|
|
RecursiveASTVisitorTests/ParenExpr.cpp
|
|
|
|
RecursiveASTVisitorTests/TemplateArgumentLocTraverser.cpp
|
[AST] Allow limiting the scope of common AST traversals (getParents, RAV).
Summary:
The goal is to allow analyses such as clang-tidy checks to run on a
subset of the AST, e.g. "only on main-file decls" for interactive tools.
Today, these become "problematically global" by running RecursiveASTVisitors
rooted at the TUDecl, or by navigating up via ASTContext::getParent().
The scope is restricted using a set of top-level-decls that RecursiveASTVisitors
should be rooted at. This also applies to the visitor that populates the
parent map, and so the top-level-decls are considered to have no parents.
This patch makes the traversal scope a mutable property of ASTContext.
The more obvious way to do this is to pass the top-level decls to
relevant functions directly, but this has some problems:
- it's error-prone: accidentally mixing restricted and unrestricted
scopes is a performance trap. Interleaving multiple analyses is
common (many clang-tidy checks run matchers or RAVs from matcher callbacks)
- it doesn't map well to the actual use cases, where we really do want
*all* traversals to be restricted.
- it involves a lot of plumbing in parts of the code that don't care
about traversals.
This approach was tried out in D54259 and D54261, I wanted to like it
but it feels pretty awful in practice.
Caveats: to get scope-limiting behavior of RecursiveASTVisitors, callers
have to call the new TraverseAST(Ctx) function instead of TraverseDecl(TU).
I think this is an improvement to the API regardless.
Reviewers: klimek, ioeric
Subscribers: mgorny, cfe-commits
Differential Revision: https://reviews.llvm.org/D54309
llvm-svn: 346847
2018-11-14 18:33:30 +08:00
|
|
|
RecursiveASTVisitorTests/TraversalScope.cpp
|
2014-10-09 23:02:06 +08:00
|
|
|
RecursiveASTVisitorTestDeclVisitor.cpp
|
2018-01-24 17:40:16 +08:00
|
|
|
RecursiveASTVisitorTestPostOrderVisitor.cpp
|
2014-10-09 23:02:06 +08:00
|
|
|
RecursiveASTVisitorTestTypeLocVisitor.cpp
|
2017-08-28 19:12:05 +08:00
|
|
|
RefactoringActionRulesTest.cpp
|
2012-07-17 16:03:01 +08:00
|
|
|
RefactoringCallbacksTest.cpp
|
2016-05-11 22:31:39 +08:00
|
|
|
RefactoringTest.cpp
|
2013-08-21 03:07:21 +08:00
|
|
|
ReplacementsYamlTest.cpp
|
2016-05-11 22:31:39 +08:00
|
|
|
RewriterTest.cpp
|
2019-09-23 20:40:10 +08:00
|
|
|
SourceCodeBuildersTest.cpp
|
2019-04-05 22:05:03 +08:00
|
|
|
SourceCodeTest.cpp
|
2019-04-19 01:23:01 +08:00
|
|
|
StencilTest.cpp
|
2016-05-11 22:31:39 +08:00
|
|
|
ToolingTest.cpp
|
2019-04-05 23:14:05 +08:00
|
|
|
TransformerTest.cpp
|
2012-06-21 17:51:42 +08:00
|
|
|
)
|
|
|
|
|
2019-07-04 06:45:55 +08:00
|
|
|
clang_target_link_libraries(ToolingTests
|
[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
|
2012-06-21 17:51:42 +08:00
|
|
|
clangAST
|
2013-12-10 20:40:37 +08:00
|
|
|
clangASTMatchers
|
|
|
|
clangBasic
|
2016-03-30 00:31:53 +08:00
|
|
|
clangFormat
|
2013-12-10 20:40:37 +08:00
|
|
|
clangFrontend
|
|
|
|
clangLex
|
2014-07-17 00:48:33 +08:00
|
|
|
clangRewrite
|
2018-12-12 16:02:18 +08:00
|
|
|
clangSerialization
|
2013-12-10 20:40:37 +08:00
|
|
|
clangTooling
|
2014-10-30 08:44:01 +08:00
|
|
|
clangToolingCore
|
2018-06-04 20:04:41 +08:00
|
|
|
clangToolingInclusions
|
2019-05-25 08:27:19 +08:00
|
|
|
clangToolingRefactoring
|
2019-10-10 10:34:47 +08:00
|
|
|
clangTransformer
|
2012-06-21 17:51:42 +08:00
|
|
|
)
|
2019-05-22 22:44:45 +08:00
|
|
|
|
2019-07-04 06:45:55 +08:00
|
|
|
target_link_libraries(ToolingTests
|
|
|
|
PRIVATE
|
|
|
|
LLVMTestingSupport
|
|
|
|
)
|
2019-05-22 22:44:45 +08:00
|
|
|
|
|
|
|
add_subdirectory(Syntax)
|