Skip to content

Add support for builtin functions #2508

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 16 commits into from
Jun 6, 2025
Merged

Conversation

orpuente-MS
Copy link
Contributor

@orpuente-MS orpuente-MS commented Jun 4, 2025

This PR adds the necessary infrastructure to support builtin functions in the lowerer and prepares the groundwork for providing language service support for const evaluated expressions. These changes are related because builtin function calls are a kind of const evaluated expression.

The PR can be understood in two areas:

  1. The part that prepares the groundwork for providing language service support for const evaluated expressions, which includes two changes: const expressions are now eagerly evaluated in the lowerer; and the Expr type is augmented with the result of const evaluating the expression, instead of just storing the final value in the AST, this will provide the language service with the necessary span and type information for its hover, jump to definition, and type hint features.
  2. The part that adds the necessary infrastructure to support builtin functions in the lowerer: this changes include adding a polymorphic dispatch mechanism for QASM bultins and wiring this mechanism to the Lowerer::lower_function_call_expr method.

@orpuente-MS orpuente-MS added this pull request to the merge queue Jun 6, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jun 6, 2025
@orpuente-MS orpuente-MS added this pull request to the merge queue Jun 6, 2025
Merged via the queue into main with commit bf5da90 Jun 6, 2025
18 checks passed
@orpuente-MS orpuente-MS deleted the oscarpuente/builtin-functions branch June 6, 2025 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants