diff options
author | Sam McCall <sam.mccall@gmail.com> | 2020-10-31 21:09:11 +0100 |
---|---|---|
committer | Sam McCall <sam.mccall@gmail.com> | 2020-11-11 12:39:43 +0100 |
commit | 98aa067109ed482e428bc16e1321dbe756efc57c (patch) | |
tree | 3dd76ff35be40c85a3bb54d576996381d9b4a8fd /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | dad804a193edf092322d80bb404fabb2f6f2c888 (diff) | |
download | llvm-98aa067109ed482e428bc16e1321dbe756efc57c.zip llvm-98aa067109ed482e428bc16e1321dbe756efc57c.tar.gz llvm-98aa067109ed482e428bc16e1321dbe756efc57c.tar.bz2 |
[Syntax] Start to move trivial Node class definitions to TableGen. NFC
This defines two node archetypes with trivial class definitions:
- Alternatives: the generated abstract classes are trivial as all
functionality is via LLVM RTTI
- Unconstrained: this is a placeholder, I think all of these are going to be
Lists but today they have no special accessors etc, so we just say
"could contain anything", and migrate them one-by-one to Sequence later.
Compared to Dmitri's prototype, Nodes.td looks more like a class hierarchy and
less like a grammar. (E.g. variants list the Alternatives parent rather than
vice versa).
The main reasons for this:
- the hierarchy is an important part of the API we want direct control over.
- e.g. we may introduce abstract bases like "loop" that the grammar doesn't
care about in order to model is-a concepts that might make refactorings
more expressive. This is less natural in a grammar-like idiom.
- e.g. we're likely to have to model some alternatives as variants and others
as class hierarchies, the choice will probably be based on natural is-a
relationships.
- it reduces the cognitive load of switching from editing *.td to working with
code that uses the generated classes
Differential Revision: https://reviews.llvm.org/D90543
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions