Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #52 +/- ##
==========================================
- Coverage 42.03% 37.15% -4.89%
==========================================
Files 117 109 -8
Lines 4320 4481 +161
==========================================
- Hits 1816 1665 -151
- Misses 2418 2736 +318
+ Partials 86 80 -6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR refactors instruction definition types across the gen and aarch64 packages to a new interface-based design, centralizes argument/target assertions, and consolidates validation and code generation logic.
- Introduce
Validatemethods onFileInfoandBasicBlockInfoand replace inline assertion functions with shared helpers ingen/assert.go. - Convert all AArch64 ISA definitions to implement
InstructionDefinitionwithOperator,Validate, andCodegenmethods. - Update codegen and translation layers to invoke the new interfaces and adjust imports accordingly.
Reviewed Changes
Copilot reviewed 75 out of 75 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| gen/file_generator.go | Use NewFileInfo + AppendFunction and validate early |
| gen/basic_block_info.go | Add Validate method to BasicBlockInfo |
| gen/assert.go | Centralize argument/target/integer assertions |
| aarch64/translation/targets.go | Remove duplicate AssertTargetsExactly implementation |
| aarch64/translation/instructions.go | Qualify assertions via gen import |
| aarch64/translation/arguments.go | Remove inline assertion implementations |
| aarch64/managers/instructions.go | Update instruction constructors to new names |
| aarch64/isa/*.go | Migrate all ISA files to new functional InstructionDefinition design |
| aarch64/isa/add_test.go | Update test helpers to return InstructionInfo + call Codegen |
| aarch64/codegen/instruction.go | Switch from Generate to Codegen on the instruction interface |
| aarch64/codegen/file.go | Adjust function index tracking for file codegen context |
Comments suppressed due to low confidence (4)
aarch64/isa/add.go:63
- Missing imports for "alon.kr/x/list" and "alon.kr/x/usm/core", which are required for
list.FromSingleandcore.Result.
return nil, list.FromSingle(core.Result{
aarch64/isa/subs.go:53
- The code uses
list.FromSingleandcore.Resultbut neither "alon.kr/x/list" nor "alon.kr/x/usm/core" is imported; add these imports.
return nil, list.FromSingle(core.Result{
aarch64/isa/bcond.go:61
- Missing imports for "alon.kr/x/list" and "alon.kr/x/usm/core" needed for
list.FromSingleandcore.Resultin the default case.
return nil, list.FromSingle(core.Result{
aarch64/isa/b.go:90
list.FromSingleandcore.Resultare referenced without importing "alon.kr/x/list" and "alon.kr/x/usm/core"; please add those imports.
return nil, list.FromSingle(core.Result{
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #51