diff options
author | Jens Massberg <massberg@google.com> | 2023-08-02 14:00:16 +0200 |
---|---|---|
committer | Jens Massberg <massberg@google.com> | 2023-08-31 10:22:21 +0200 |
commit | c2bf9baf59870532d0c503066634bf438c35184f (patch) | |
tree | 1d573ee06b443c234c3d512e079bf70d41b9a888 /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | 831b509d5f73a4e8f86cf01de41c6e96f33de013 (diff) | |
download | llvm-c2bf9baf59870532d0c503066634bf438c35184f.zip llvm-c2bf9baf59870532d0c503066634bf438c35184f.tar.gz llvm-c2bf9baf59870532d0c503066634bf438c35184f.tar.bz2 |
Add a concept AST node.
This patch adds a concept AST node (`ConceptLoc`) and uses it at the corresponding places.
There are three objects that might have constraints via concepts:
`TypeConstraint`, `ConceptSpecializationExpr` and `AutoTypeLoc`.
The first two inherit from `ConceptReference` while the latter has
the information about a possible constraint directly stored in `AutoTypeLocInfo`. It would be nice if the concept information would be stored the same way in all three cases.
Moreover the current structure makes it difficult to deal with these concepts. For example in Clangd accessing the locations of constraints of a `AutoTypeLoc` can only be done with quite ugly hacks.
So we think that it makes sense to create a new AST node for such concepts.
In details we propose the following:
- Rename `ConceptReference` to `ConceptLoc` (or something else what is approriate)
and make it the new AST node.
- `TypeConstraint` and `ConceptSpecializationExpr` do not longer inherit from `ConceptReference` but store a pointer to a `ConceptLoc`.
- `AutoTypeLoc` stores a pointer to `ConceptLoc` instead of storing the concept info in `AutoTypeLocInfo`.
This patch implements a first version of this idea which compiles and where the existing tests pass.
To make this patch as small as possible we keep the existing member functions to access concept data. Later these can be replaced by directly calling the corresponding functions of the `ConceptLoc`s.
Differential Revision: https://reviews.llvm.org/D155858
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions