Go to file
Sean Callanan fe929aa33c Testbed and skeleton of a new expression parser
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: 290004
2016-12-16 23:21:38 +00:00
clang Testbed and skeleton of a new expression parser 2016-12-16 23:21:38 +00:00
clang-tools-extra [include-fixer] Desugar incomplete types. 2016-12-16 16:09:06 +00:00
compiler-rt Follow-up for r289831: Lower the unjoined thread count to 100 in the libcxx-future.mm testcase. 2016-12-16 18:44:01 +00:00
debuginfo-tests New round of fixes for "Always compile debuginfo-tests for the host triple" 2014-10-18 23:47:59 +00:00
libclc Fix build since r286752. 2016-11-14 16:06:33 +00:00
libcxx [CMake] Put headers relative to clang 2016-12-16 17:30:51 +00:00
libcxxabi [libc++abi] Mark failing test on Darwin as XFAIL 2016-12-13 02:43:04 +00:00
libunwind EHABI: mark some functions as exported 2016-11-17 23:53:35 +00:00
lld Fix compiler warning. 2016-12-16 23:12:58 +00:00
lldb Fix compiler warning. 2016-12-16 21:35:12 +00:00
llgo [llgo] Remove support for LLVM attributes 2016-12-06 19:22:04 +00:00
llvm ModuleSummaryAnalysis: Remove some duplicate code. NFCI. 2016-12-16 23:19:02 +00:00
openmp Follow up to r289732: Update comments in source files to reference .cpp files 2016-12-14 23:01:24 +00:00
parallel-libs [Acxxel] Remove setActiveDeviceForThread 2016-10-28 00:54:02 +00:00
polly Revert "Fix debug info metadata for upstream change in LLVM." 2016-12-16 19:39:18 +00:00