Skip to content

Remove usages of void * in CASTBridging.h #68346

@ahoppen

Description

@ahoppen

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 a BridgedExpr instead of void *

Metadata

Metadata

Assignees

Labels

ASTGenArea → compiler: The ASTGen module, which translates SwiftSyntax trees to the C++ ASTcompilerThe Swift compiler itself

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions