Skip to content

Customizability Extensions: CFunction Signatures and Code Literals

Frederik Hennig requested to merge ast_extensions into backend-rework

This MR extends the expressivity of CFunction by allowing users to specify its type signature, and introduces literal expressions.

  • CFunction Signature: Instances of CFunction now have to be created with a fixed type signature, which is used by the typifier.
  • Literal expressions: Introduce PsLiteral and PsLiteralExpr to allow injection of custom code literals into the AST. Literals must have a fixed type, and are considered constant within the scope of a kernel.

This MR furthermore fixes CFunction printing, and a bug that affected typification and constant elimination in the presence of array initializers.

  • Test cases for literals
Edited by Frederik Hennig

Merge request reports