Skip to content

Commit da00bf9

Browse files
committed
Swift: move TBD code to ql
This allows to avoid bypassing label type correcness in the extractor, and allows to independently resolve TBD extractions, as with this approach TBD nodes do have the correctly typed trap label. The TBD status is now a predicate on the QL side. This requires: * a default visit using the correct type, which is achieved via macro metaprogramming in `VisitorBase.h`, following the way `swift::ASTVisitor` is programmed * a mapping from labels to corresponding binding trap entries. The functor is defined in `TrapTagTraits.h` and instantiated in generated `TrapEntries.h` * Binding trap entries for TBD unknown entities must not have any other field than the `id` (after all, we are supposed to not extract them yet). This is why all unextracted fields in `schema.yml` have been commented out, and will be uncommentend when visitors are added
1 parent 20af134 commit da00bf9

File tree

178 files changed

+928
-2146
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

178 files changed

+928
-2146
lines changed

swift/codegen/BUILD.bazel

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,10 @@ py_binary(
2727
py_binary(
2828
name = "trapgen",
2929
srcs = ["trapgen.py"],
30-
data = ["//swift/codegen/templates:trap"],
30+
data = [
31+
"//swift:dbscheme",
32+
"//swift/codegen/templates:trap",
33+
],
3134
visibility = ["//swift:__subpackages__"],
3235
deps = [
3336
"//swift/codegen/lib",
@@ -38,7 +41,11 @@ py_binary(
3841
py_binary(
3942
name = "cppgen",
4043
srcs = ["cppgen.py"],
41-
data = ["//swift/codegen/templates:cpp"],
44+
data = [
45+
":schema",
46+
":schema_includes",
47+
"//swift/codegen/templates:cpp",
48+
],
4249
visibility = ["//swift:__subpackages__"],
4350
deps = [
4451
"//swift/codegen/lib",

0 commit comments

Comments
 (0)