-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Labels
ASTGenArea → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ ASTArea → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ ASTcompilerThe Swift compiler itselfThe Swift compiler itself
Description
We are using void * for all parameters that pass AST nodes around. This gives us no type safety and makes it really easy to e.g. pass an Expr to a parameter that takes a Decl.
We have two options to fix this:
- Use C++ interop to pass around the actual AST node types
- For every C++ AST node, define a C struct that wraps the
void *, e.g.BridgedExpr { void *expr }and then mark the parameter as taking aBridgedExprinstead ofvoid *
Metadata
Metadata
Assignees
Labels
ASTGenArea → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ ASTArea → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ ASTcompilerThe Swift compiler itselfThe Swift compiler itself