2016-08-31 08:46:32 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
|
|
Option
|
2020-04-08 00:26:40 +08:00
|
|
|
FrontendOpenMP
|
2016-08-31 08:46:32 +08:00
|
|
|
Support
|
|
|
|
)
|
2012-04-04 20:07:46 +08:00
|
|
|
|
2014-10-30 02:55:09 +08:00
|
|
|
add_subdirectory(Core)
|
2018-06-04 17:04:12 +08:00
|
|
|
add_subdirectory(Inclusions)
|
2017-03-01 21:14:01 +08:00
|
|
|
add_subdirectory(Refactoring)
|
2017-07-21 20:49:28 +08:00
|
|
|
add_subdirectory(ASTDiff)
|
2021-03-15 00:18:54 +08:00
|
|
|
add_subdirectory(DumpTool)
|
2019-05-22 22:44:45 +08:00
|
|
|
add_subdirectory(Syntax)
|
2019-06-27 05:11:51 +08:00
|
|
|
add_subdirectory(DependencyScanning)
|
2019-10-10 10:34:47 +08:00
|
|
|
add_subdirectory(Transformer)
|
2014-10-30 02:55:09 +08:00
|
|
|
|
2021-03-15 00:18:54 +08:00
|
|
|
# Replace the last lib component of the current binary directory with include
|
|
|
|
string(FIND ${CMAKE_CURRENT_BINARY_DIR} "/lib/" PATH_LIB_START REVERSE)
|
|
|
|
if(PATH_LIB_START EQUAL -1)
|
|
|
|
message(FATAL_ERROR "Couldn't find lib component in binary directory")
|
|
|
|
endif()
|
|
|
|
math(EXPR PATH_LIB_END "${PATH_LIB_START}+5")
|
|
|
|
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD)
|
|
|
|
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} ${PATH_LIB_END} -1 PATH_TAIL)
|
|
|
|
string(CONCAT BINARY_INCLUDE_DIR ${PATH_HEAD} "/include/clang/" ${PATH_TAIL})
|
|
|
|
|
|
|
|
if (NOT Python3_EXECUTABLE
|
2021-04-23 06:52:23 +08:00
|
|
|
OR APPLE
|
2021-04-18 20:53:48 +08:00
|
|
|
OR CMAKE_CROSSCOMPILING
|
2021-03-15 00:18:54 +08:00
|
|
|
OR GENERATOR_IS_MULTI_CONFIG
|
|
|
|
OR NOT LLVM_NATIVE_ARCH IN_LIST LLVM_TARGETS_TO_BUILD
|
|
|
|
)
|
2021-03-17 09:48:50 +08:00
|
|
|
configure_file(
|
|
|
|
EmptyNodeIntrospection.inc.in
|
|
|
|
${BINARY_INCLUDE_DIR}/NodeIntrospection.inc
|
|
|
|
COPYONLY
|
2021-03-15 00:18:54 +08:00
|
|
|
)
|
|
|
|
set(CLANG_TOOLING_BUILD_AST_INTROSPECTION "OFF" CACHE BOOL "")
|
|
|
|
else()
|
|
|
|
# The generation of ASTNodeAPI.json takes a long time in a
|
|
|
|
# Debug build due to parsing AST.h. Disable the processing
|
|
|
|
# but setting CLANG_TOOLING_BUILD_AST_INTROSPECTION as an
|
|
|
|
# internal hidden setting to override.
|
|
|
|
# When the processing is disabled, a trivial/empty JSON
|
|
|
|
# file is generated by clang-ast-dump and generate_cxx_src_locs.py
|
|
|
|
# generates the same API, but with a trivial implementation.
|
|
|
|
option(CLANG_TOOLING_BUILD_AST_INTROSPECTION "Enable AST introspection" TRUE)
|
|
|
|
|
|
|
|
set(skip_expensive_processing $<OR:$<CONFIG:Debug>,$<NOT:$<BOOL:${CLANG_TOOLING_BUILD_AST_INTROSPECTION}>>>)
|
|
|
|
|
|
|
|
set(implicitDirs)
|
|
|
|
foreach(implicitDir ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES})
|
|
|
|
list(APPEND implicitDirs -I ${implicitDir})
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
COMMENT Generate ASTNodeAPI.json
|
|
|
|
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
|
2021-04-15 07:14:52 +08:00
|
|
|
DEPENDS clang-ast-dump clang-resource-headers
|
2021-03-15 00:18:54 +08:00
|
|
|
COMMAND
|
|
|
|
$<TARGET_FILE:clang-ast-dump>
|
|
|
|
# Skip this in debug mode because parsing AST.h is too slow
|
|
|
|
--skip-processing=${skip_expensive_processing}
|
|
|
|
-I ${CMAKE_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include
|
|
|
|
-I ${CMAKE_SOURCE_DIR}/../clang/include
|
|
|
|
-I ${CMAKE_BINARY_DIR}/tools/clang/include
|
|
|
|
-I ${CMAKE_BINARY_DIR}/include
|
|
|
|
-I ${CMAKE_SOURCE_DIR}/include
|
|
|
|
${implicitDirs}
|
|
|
|
--json-output-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(run-ast-api-dump-tool
|
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
COMMENT Generate NodeIntrospection.inc
|
|
|
|
OUTPUT ${BINARY_INCLUDE_DIR}/NodeIntrospection.inc
|
|
|
|
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py
|
2021-03-17 09:48:50 +08:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in
|
2021-03-15 00:18:54 +08:00
|
|
|
COMMAND
|
|
|
|
${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/DumpTool/generate_cxx_src_locs.py
|
|
|
|
--json-input-path ${CMAKE_CURRENT_BINARY_DIR}/ASTNodeAPI.json
|
|
|
|
--output-file NodeIntrospection.inc
|
2021-03-17 09:48:50 +08:00
|
|
|
--use-empty-implementation ${skip_expensive_processing}
|
|
|
|
--empty-implementation
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/EmptyNodeIntrospection.inc.in"
|
2021-03-15 00:18:54 +08:00
|
|
|
COMMAND
|
|
|
|
${CMAKE_COMMAND} -E copy_if_different
|
|
|
|
${CMAKE_CURRENT_BINARY_DIR}/NodeIntrospection.inc
|
|
|
|
${BINARY_INCLUDE_DIR}/NodeIntrospection.inc
|
|
|
|
)
|
|
|
|
|
|
|
|
add_custom_target(run-ast-api-generate-tool
|
|
|
|
DEPENDS
|
|
|
|
${BINARY_INCLUDE_DIR}/NodeIntrospection.inc
|
|
|
|
)
|
|
|
|
endif()
|
|
|
|
|
2012-04-04 20:07:46 +08:00
|
|
|
add_clang_library(clangTooling
|
2018-01-05 18:32:16 +08:00
|
|
|
AllTUsExecution.cpp
|
2012-07-27 14:18:12 +08:00
|
|
|
ArgumentsAdjusters.cpp
|
2012-08-23 04:52:52 +08:00
|
|
|
CommonOptionsParser.cpp
|
2012-04-04 20:07:46 +08:00
|
|
|
CompilationDatabase.cpp
|
2017-10-26 18:38:14 +08:00
|
|
|
Execution.cpp
|
[clang][Tooling] Add support for .rsp files in compile_commands.json
Summary:
Add support for .rsp files.
Fixes https://github.com/clangd/clangd/issues/81
Patch By: liu hui(@lh123)
Reviewers: sammccall, ilya-biryukov, hokein, kadircet
Reviewed By: kadircet
Subscribers: merge_guards_bot, mgorny, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D70222
2019-11-29 19:14:25 +08:00
|
|
|
ExpandResponseFilesCompilationDatabase.cpp
|
2012-10-09 00:08:15 +08:00
|
|
|
FileMatchTrie.cpp
|
2016-05-11 22:31:39 +08:00
|
|
|
FixIt.cpp
|
2019-06-26 15:39:03 +08:00
|
|
|
GuessTargetAndModeCompilationDatabase.cpp
|
2018-04-09 23:17:39 +08:00
|
|
|
InterpolatingCompilationDatabase.cpp
|
2012-08-24 13:50:27 +08:00
|
|
|
JSONCompilationDatabase.cpp
|
2012-05-24 00:29:20 +08:00
|
|
|
Refactoring.cpp
|
2012-07-17 16:03:01 +08:00
|
|
|
RefactoringCallbacks.cpp
|
2017-10-26 18:38:14 +08:00
|
|
|
StandaloneExecution.cpp
|
2021-03-15 00:18:54 +08:00
|
|
|
NodeIntrospection.cpp
|
|
|
|
${BINARY_INCLUDE_DIR}/NodeIntrospection.inc
|
2012-07-27 14:18:12 +08:00
|
|
|
Tooling.cpp
|
2012-06-21 09:30:21 +08:00
|
|
|
|
2016-08-31 08:46:25 +08:00
|
|
|
DEPENDS
|
|
|
|
ClangDriverOptions
|
[openmp] Base of tablegen generated OpenMP common declaration
Summary:
As discussed previously when landing patch for OpenMP in Flang, the idea is
to share common part of the OpenMP declaration between the different Frontend.
While doing this it was thought that moving to tablegen instead of Macros will also
give a cleaner and more powerful way of generating these declaration.
This first part of a future series of patches is setting up the base .td file for
DirectiveLanguage as well as the OpenMP version of it. The base file is meant to
be used by other directive language such as OpenACC.
In this first patch, the Directive and Clause enums are generated with tablegen
instead of the macros on OMPConstants.h. The next pacth will extend this
to other enum and move the Flang frontend to use it.
Reviewers: jdoerfert, DavidTruby, fghanim, ABataev, jdenny, hfinkel, jhuber6, kiranchandramohan, kiranktp
Reviewed By: jdoerfert, jdenny
Subscribers: arphaman, martong, cfe-commits, mgorny, yaxunl, hiraditya, guansong, jfb, sstefan1, aaron.ballman, llvm-commits
Tags: #llvm, #openmp, #clang
Differential Revision: https://reviews.llvm.org/D81736
2020-06-23 21:29:50 +08:00
|
|
|
omp_gen
|
2016-08-31 08:46:25 +08:00
|
|
|
|
2014-02-26 14:41:29 +08:00
|
|
|
LINK_LIBS
|
2012-06-21 09:30:21 +08:00
|
|
|
clangAST
|
2012-07-17 16:03:01 +08:00
|
|
|
clangASTMatchers
|
2013-12-10 03:04:43 +08:00
|
|
|
clangBasic
|
|
|
|
clangDriver
|
2016-03-30 00:31:53 +08:00
|
|
|
clangFormat
|
2013-12-10 03:04:43 +08:00
|
|
|
clangFrontend
|
|
|
|
clangLex
|
2014-07-17 00:48:33 +08:00
|
|
|
clangRewrite
|
2018-12-12 16:02:18 +08:00
|
|
|
clangSerialization
|
2014-10-30 02:55:09 +08:00
|
|
|
clangToolingCore
|
2012-06-21 09:30:21 +08:00
|
|
|
)
|