2015-10-21 02:12:12 +08:00
|
|
|
create_subdirectory_options(CLANG TOOL)
|
2013-08-22 23:50:02 +08:00
|
|
|
|
2015-10-21 02:12:12 +08:00
|
|
|
add_clang_subdirectory(diagtool)
|
|
|
|
add_clang_subdirectory(driver)
|
2017-07-21 20:49:28 +08:00
|
|
|
add_clang_subdirectory(clang-diff)
|
2015-10-21 02:12:12 +08:00
|
|
|
add_clang_subdirectory(clang-format)
|
|
|
|
add_clang_subdirectory(clang-format-vs)
|
|
|
|
add_clang_subdirectory(clang-fuzzer)
|
Testbed and skeleton of a new expression parser
Recommitted after formal approval.
LLVM's JIT is now the foundation of dynamic-compilation features for many languages. Clang also has low-level support for dynamic compilation (ASTImporter and ExternalASTSource, notably). How the compiler is set up for dynamic parsing is generally left up to individual clients, for example LLDB's C/C++/Objective-C expression parser and the ROOT project.
Although this arrangement offers external clients the flexibility to implement dynamic features as they see fit, the lack of an in-tree client means that subtle bugs can be introduced that cause regressions in the external clients but aren't caught by tests (or users) until much later. LLDB for example regularly encounters complicated ODR violation scenarios where it is not immediately clear who is at fault.
Other external clients (notably, Cling) rely on similar functionality, and another goal is to break this functionality up into composable parts so that any client can be built easily on top of Clang without requiring extensive additional code.
I propose that the parts required to build a simple expression parser be added to Clang. Initially, I aim to have the following features:
A piece that looks up external declarations from a variety of sources (e.g., from previous dynamic compilations, from modules, or from DWARF) and uses clear conflict resolution rules to reconcile differences, with easily understood errors. This functionality will be supported by in-tree tests.
A piece that works hand in hand with the LLVM JIT to resolve the locations of external declarations so that e.g. variables can be redeclared and (for high-performance applications like DTrace) external variables can be accessed directly from the registers where they reside.
This commit adds a tester that parses a sequence of source files and then uses them as source data for an expression. External references are resolved using an ExternalASTSource that responds to name queries using an ASTImporter. This is the setup that LLDB uses, and the motivating reason for MinimalImport in ASTImporter. When complete, this tester will implement the first of the above goals.
Differential Revision: https://reviews.llvm.org/D27180
llvm-svn: 290367
2016-12-23 04:03:14 +08:00
|
|
|
add_clang_subdirectory(clang-import-test)
|
clang-offload-bundler - offload files bundling/unbundling tool
Summary:
One of the goals of programming models that support offloading (e.g. OpenMP) is to enable users to offload with little effort, by annotating the code with a few pragmas. I'd also like to save users the trouble of changing their existent applications' build system. So having the compiler always return a single file instead of one for the host and each target even if the user is doing separate compilation is desirable.
This diff proposes a tool named clang-offload-bundler (happy to change the name if required) that is used to bundle files associated with the same user source file but different targets, or to unbundle a file into separate files associated with different targets.
This tool supports the driver support for OpenMP under review in http://reviews.llvm.org/D9888. The tool is used there to enable separate compilation, so that the very first action on input files that are not source files is a "unbundling action" and the very last non-linking action is a "bundling action".
The format of the bundled files is currently very simple: text formats are concatenated with comments that have a magic string and target identifying triple in between, and binary formats have a header that contains the triple and the offset and size of the code for host and each target.
The goal is to improve this tool in the future to deal with archive files so that each individual file in the archive is properly dealt with. We see that archives are very commonly used in current applications to combine separate compilation results. So I'm convinced users would enjoy this feature.
This tool can be used like this:
`clang-offload-bundler -targets=triple1,triple2 -type=ii -inputs=a.triple1.ii,a.triple2.ii -outputs=a.ii`
or
`clang-offload-bundler -targets=triple1,triple2 -type=ii -outputs=a.triple1.ii,a.triple2.ii -inputs=a.ii -unbundle`
I implemented the tool under clang/tools. Please let me know if something like this should live somewhere else.
This patch is prerequisite for http://reviews.llvm.org/D9888.
Reviewers: hfinkel, rsmith, echristo, chandlerc, tra, jlebar, ABataev, Hahnfeld
Subscribers: whchung, caomhin, andreybokhanko, arpith-jacob, carlo.bertolli, mehdi_amini, guansong, Hahnfeld, cfe-commits
Differential Revision: https://reviews.llvm.org/D13909
llvm-svn: 279632
2016-08-24 23:21:05 +08:00
|
|
|
add_clang_subdirectory(clang-offload-bundler)
|
2019-10-10 04:42:58 +08:00
|
|
|
add_clang_subdirectory(clang-offload-wrapper)
|
2019-06-13 05:32:49 +08:00
|
|
|
add_clang_subdirectory(clang-scan-deps)
|
2015-10-21 02:12:12 +08:00
|
|
|
|
|
|
|
add_clang_subdirectory(c-index-test)
|
2014-07-15 06:17:16 +08:00
|
|
|
|
2017-07-01 00:36:09 +08:00
|
|
|
add_clang_subdirectory(clang-rename)
|
2017-09-14 18:06:52 +08:00
|
|
|
add_clang_subdirectory(clang-refactor)
|
2019-05-17 12:20:01 +08:00
|
|
|
if(UNIX)
|
|
|
|
add_clang_subdirectory(clang-shlib)
|
|
|
|
endif()
|
2017-07-01 00:36:09 +08:00
|
|
|
|
2013-08-22 23:50:02 +08:00
|
|
|
if(CLANG_ENABLE_ARCMT)
|
2015-10-21 02:12:12 +08:00
|
|
|
add_clang_subdirectory(arcmt-test)
|
|
|
|
add_clang_subdirectory(c-arcmt-test)
|
2013-08-22 23:50:02 +08:00
|
|
|
endif()
|
2014-07-17 00:48:33 +08:00
|
|
|
|
2013-07-04 00:20:29 +08:00
|
|
|
if(CLANG_ENABLE_STATIC_ANALYZER)
|
2015-10-21 02:12:12 +08:00
|
|
|
add_clang_subdirectory(clang-check)
|
[analyzer][CrossTU][NFC] Generalize to external definitions instead of external functions
Summary: This is just changing naming and documentation to be general about external definitions that can be imported for cross translation unit analysis. There is at least a plan to add VarDecls: D46421
Reviewers: NoQ, xazax.hun, martong, a.sidorin, george.karpenkov, serge-sans-paille
Reviewed By: xazax.hun, martong
Subscribers: mgorny, whisperity, baloghadamsoftware, szepet, rnkovacs, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, cfe-commits
Differential Revision: https://reviews.llvm.org/D56441
llvm-svn: 350852
2019-01-11 01:44:04 +08:00
|
|
|
add_clang_subdirectory(clang-extdef-mapping)
|
2016-01-13 10:03:50 +08:00
|
|
|
add_clang_subdirectory(scan-build)
|
|
|
|
add_clang_subdirectory(scan-view)
|
2013-07-04 00:20:29 +08:00
|
|
|
endif()
|
2012-08-07 16:37:42 +08:00
|
|
|
|
|
|
|
# We support checking out the clang-tools-extra repository into the 'extra'
|
|
|
|
# subdirectory. It contains tools developed as part of the Clang/LLVM project
|
|
|
|
# on top of the Clang tooling platform. We keep them in a separate repository
|
|
|
|
# to keep the primary Clang repository small and focused.
|
2012-10-10 21:46:18 +08:00
|
|
|
# It also may be included by LLVM_EXTERNAL_CLANG_TOOLS_EXTRA_SOURCE_DIR.
|
|
|
|
add_llvm_external_project(clang-tools-extra extra)
|
2016-03-03 19:09:43 +08:00
|
|
|
|
|
|
|
# libclang may require clang-tidy in clang-tools-extra.
|
|
|
|
add_clang_subdirectory(libclang)
|