Skip to content

Add issue descriptions for struct support with attribute access#3

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/define-structs-and-access-attributes
Draft

Add issue descriptions for struct support with attribute access#3
Copilot wants to merge 3 commits intomainfrom
copilot/define-structs-and-access-attributes

Conversation

Copy link
Copy Markdown

Copilot AI commented Nov 30, 2025

Notes

  • This repository uses an AI bot for reviews. Keep your PR in Draft while
    you work. When you're ready for a review, change the status to Ready for
    review
    to trigger a new review round. If you make additional changes and
    don't want to trigger the bot, switch the PR back to Draft.
  • AI-bot comments may not always be accurate. Please review them critically and
    share your feedback; it helps us improve the tool.
  • Avoid changing code that is unrelated to your proposal. Keep your PR as short
    as possible to increase the chances of a timely review. Large PRs may not be
    reviewed and may be closed.
  • Don't add unnecessary comments. Your code should be readable and
    self-documenting
    (guidance).
  • Don't change core features without prior discussion with the community. Use
    our Discord to discuss ideas, blockers, or issues
    (https://discord.gg/Nu4MdGj9jB).
  • Do not include secrets (API keys, tokens, passwords), credentials, or
    sensitive data/PII in code, configs, logs, screenshots, or commit history. If
    something leaks, rotate the credentials immediately, invalidate the old key,
    and note it in the PR so maintainers can assist.
  • Do not commit large binaries or generated artifacts. If large datasets are
    needed for tests, prefer small fixtures or programmatic downloads declared in
    makim.yaml (e.g., a task that fetches data at test time). If a large binary is
    unavoidable, discuss first and consider Git LFS.

Pull Request description

Analysis and issue proposals for adding struct support to IRx, inspired by LLVM's CodeGenTypes.cpp#L792.

Key findings:

  • astx already provides StructDefStmt/StructDeclStmt but IRx lacks LLVM IR codegen
  • LLVM uses IdentifiedStructType + GEP for struct field access
  • Implementation requires 6 phases (each with a separate issue document)

Added 6 separate issue proposal documents in docs/proposals/:

  1. phase1-struct-type-definition.md - Translate StructDefStmt → LLVM IdentifiedStructType
  2. phase2-struct-type-reference.md - New StructType class for variable declarations
  3. phase3-struct-instantiation.md - New StructExpr with field initializers
  4. phase4-attribute-access-read.md - New AttributeExpr using GEP + load
  5. phase5-attribute-assignment-write.md - New AttributeAssignment using GEP + store
  6. phase6-testing-documentation.md - Comprehensive tests and documentation

Target LLVM IR pattern:

%"Point" = type {i32, i32}

%p = alloca %"Point"
%x_ptr = getelementptr %"Point", %"Point"* %p, i32 0, i32 0
store i32 10, i32* %x_ptr
%x = load i32, i32* %x_ptr

Files to modify: src/irx/system.py, src/irx/builders/llvmliteir.py

Each issue document contains:

  • Issue title ready for GitHub
  • Description and background
  • Task checklists
  • Example code and expected LLVM IR
  • Files to modify
  • Dependencies on prior phases
  • Acceptance criteria

How to test these changes

  • Review the proposal documents in docs/proposals/
  • No code implementation in this PR—documentation/analysis only

Pull Request checklists

This PR is a:

  • bug-fix
  • new feature
  • maintenance

About this PR:

  • it includes tests.
  • the tests are executed on CI.
  • the tests generate log file(s) (path).
  • pre-commit hooks were executed locally.
  • this PR requires a project documentation update.

Author's checklist:

  • I have reviewed the changes and it contains no misspelling.
  • The code is well commented, especially in the parts that contain more
    complexity.
  • New and old tests passed locally.

Additional information

This PR adds 6 separate issue proposal documents in docs/proposals/, each containing a complete issue title and implementation plan for one phase of struct support. The documents can be used directly to create separate GitHub issues for tracking the implementation work.

Reviewer's checklist

Copy and paste this template for your review's note:

## Reviewer's Checklist

- [ ] I managed to reproduce the problem locally from the `main` branch
- [ ] I managed to test the new changes locally
- [ ] I confirm that the issues mentioned were fixed/resolved .
Original prompt

I wanted to analyze the whole repository and I have a suggestion by maintainer of this repo that , he wants that
defining the structs and accessing their values by attributes
not sure .. but maybe this could give you some ideas: https://github.com/llvm/llvm-project/blob/main/clang/lib/CodeGen/CodeGenTypes.cpp#L792****
Can you analyze what is it and suggest me by analyzing


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Nov 30, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI changed the title [WIP] Analyze repository for struct definitions and attribute access Add issue description for struct support with attribute access Nov 30, 2025
Copilot AI requested a review from omsherikar November 30, 2025 16:14
@omsherikar
Copy link
Copy Markdown
Owner

@copilot yes please

Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Nov 30, 2025

@copilot yes please

Created the issue proposal document at docs/proposals/struct-support-issue.md (commit 141f86c). It contains the complete issue title and 6-phase description you can use to create the GitHub issue.

@omsherikar
Copy link
Copy Markdown
Owner

@copilot I want like seperate issues and its description not in 1 issue only

Co-authored-by: omsherikar <180152315+omsherikar@users.noreply.github.com>
Copy link
Copy Markdown
Author

Copilot AI commented Nov 30, 2025

@copilot I want like seperate issues and its description not in 1 issue only

Split into 6 separate issue files in docs/proposals/ (commit 550a031):

  1. phase1-struct-type-definition.md
  2. phase2-struct-type-reference.md
  3. phase3-struct-instantiation.md
  4. phase4-attribute-access-read.md
  5. phase5-attribute-assignment-write.md
  6. phase6-testing-documentation.md

Each file contains the issue title, description, tasks, example code, and acceptance criteria.

Copilot AI changed the title Add issue description for struct support with attribute access Add issue descriptions for struct support with attribute access Nov 30, 2025
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