Skip to content

C++: Support the spaceship operator in the IR #20069

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 2 commits into from
Jul 16, 2025
Merged

Conversation

jketema
Copy link
Contributor

@jketema jketema commented Jul 16, 2025

No description provided.

@github-actions github-actions bot added the C++ label Jul 16, 2025
@jketema jketema marked this pull request as ready for review July 16, 2025 16:07
@Copilot Copilot AI review requested due to automatic review settings July 16, 2025 16:07
@jketema jketema requested a review from a team as a code owner July 16, 2025 16:07
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request adds support for the C++ spaceship operator (<=>) in the Intermediate Representation (IR) by introducing a new Spaceship opcode and corresponding instruction classes. The changes enable proper handling of three-way comparison operations in the IR generation pipeline.

Key changes:

  • Added Spaceship opcode to the IR opcode definitions
  • Created CompareThreeWayInstruction classes across IR implementations
  • Updated expression translation to handle SpaceshipExpr operations

Reviewed Changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated no comments.

Show a summary per file
File Description
cpp/ql/lib/semmle/code/cpp/ir/implementation/Opcode.qll Adds the Spaceship opcode definition for three-way comparison
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/internal/TranslatedExpr.qll Adds translation logic for spaceship expressions
cpp/ql/lib/semmle/code/cpp/ir/implementation/raw/Instruction.qll Defines CompareThreeWayInstruction class for raw IR
cpp/ql/lib/semmle/code/cpp/ir/implementation/aliased_ssa/Instruction.qll Defines CompareThreeWayInstruction class for aliased SSA IR
cpp/ql/lib/semmle/code/cpp/ir/implementation/unaliased_ssa/Instruction.qll Defines CompareThreeWayInstruction class for unaliased SSA IR
Multiple .expected files Updated test expectations showing proper spaceship operator handling

@jketema jketema added the no-change-note-required This PR does not need a change note label Jul 16, 2025
Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM if DCA is happy!

@jketema
Copy link
Contributor Author

jketema commented Jul 16, 2025

DCA is uneventful

@jketema jketema merged commit eabe651 into github:main Jul 16, 2025
15 checks passed
@jketema jketema deleted the spaceship-ir branch July 16, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C++ no-change-note-required This PR does not need a change note
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants