LibWeb+LibGC: Teach Swift about GC::Cell, and start writing a Swift class in LibWeb that is gc-allocated
Add the proper annotations for the Cell and Cell::Visitor classes to be visible in Swift. This lets us remove some OpaquePointer shinangians in the Swift bindings.
In the meantime, work around two swift issues:
Boolean bitfield fields are improperly imported: https://github.com/swiftlang/swift/issues/80182 Imported derived classes cannot be cast to Base*: https://github.com/swiftlang/swift/issues/80231
There's another issue I worked around but haven't quite reported yet:
On GC::Cell::Visitor, we have these 4 methods:
void visit(Cell* cell);
void visit(Cell const* cell);
void visit(Cell& cell);
void visit(Cell const& cell);
The versions that take const& and const* are imported in an ambiguous way, and the compiler can't figure out which one to call when using a GC::Cell reference from Swift.
.. There's also the fact that calling visitor.visitUnsafe(parser.ptr()) from my speculative parser's visitEdges ICE's the frontend in IRGen.
cc @etcwilde @egorzhdan @Xazax-hun
n.b.: https://forums.swift.org/t/ladybird-gc-and-imported-class-hierarchies/78790
Your pull request has conflicts that need to be resolved before it can be reviewed and merged. Make sure to rebase your branch on top of the latest master.