|
9 | 9 |
|
10 | 10 | namespace codeql {
|
11 | 11 |
|
12 |
| -// codegen goes with QL acronym convention (Sil instead of SIL), we need to remap it to Swift's |
13 |
| -// convention |
14 |
| -using SILBlockStorageTypeTag = SilBlockStorageTypeTag; |
15 |
| -using SILBoxTypeTag = SilBoxTypeTag; |
16 |
| -using SILFunctionTypeTag = SilFunctionTypeTag; |
17 |
| -using SILTokenTypeTag = SilTokenTypeTag; |
18 |
| - |
19 | 12 | // OverloadSetRefExpr is collapsed with its only derived class OverloadedDeclRefExpr
|
20 | 13 | using OverloadSetRefExprTag = OverloadedDeclRefExprTag;
|
21 | 14 |
|
| 15 | +// We don't really expect to see the following in extraction. Mapping these tags to void effectively |
| 16 | +// ignores all elements of that class (with a message). |
| 17 | + |
| 18 | +// only generated for code editing |
| 19 | +using CodeCompletionExprTag = void; |
| 20 | +using EditorPlaceholderExprTag = void; |
| 21 | +// not present after the Sema phase |
| 22 | +using ArrowExprTag = void; |
| 23 | +// experimental variadic generics, implemented only in the frontend for now, thus not compilable |
| 24 | +using PackExprTag = void; |
| 25 | +using PackTypeTag = void; |
| 26 | +using ReifyPackExprTag = void; |
| 27 | +using PackExpansionTypeTag = void; |
| 28 | +// Placeholder types appear in ambiguous types but are anyway transformed to UnresolvedType |
| 29 | +using PlaceholderTypeTag = void; |
| 30 | +// SIL types that cannot really appear in the frontend run |
| 31 | +using SILBlockStorageTypeTag = void; |
| 32 | +using SILBoxTypeTag = void; |
| 33 | +using SILFunctionTypeTag = void; |
| 34 | +using SILTokenTypeTag = void; |
| 35 | + |
22 | 36 | #define MAP_TYPE_TO_TAG(TYPE, TAG) \
|
23 | 37 | template <> \
|
24 | 38 | struct detail::ToTagFunctor<TYPE> { \
|
25 | 39 | using type = TAG; \
|
26 | 40 | }
|
27 | 41 | #define MAP_TAG(TYPE) MAP_TYPE_TO_TAG(swift::TYPE, TYPE##Tag)
|
28 |
| -#define MAP_SUBTAG(TYPE, PARENT) \ |
29 |
| - MAP_TAG(TYPE); \ |
30 |
| - static_assert(std::is_base_of_v<PARENT##Tag, TYPE##Tag>, \ |
| 42 | +#define MAP_SUBTAG(TYPE, PARENT) \ |
| 43 | + MAP_TAG(TYPE); \ |
| 44 | + static_assert(std::is_same_v<TYPE##Tag, void> || std::is_base_of_v<PARENT##Tag, TYPE##Tag>, \ |
31 | 45 | #PARENT "Tag must be a base of " #TYPE "Tag");
|
32 | 46 |
|
33 | 47 | #define OVERRIDE_TAG(TYPE, TAG) \
|
|
0 commit comments