Skip to content

Deduplicate IObjectNodeWithAlignment into shared Common dependency analysis#130325

Open
MichalStrehovsky with Copilot wants to merge 2 commits into
mainfrom
copilot/move-shared-iobjectnodewithalignment
Open

Deduplicate IObjectNodeWithAlignment into shared Common dependency analysis#130325
MichalStrehovsky with Copilot wants to merge 2 commits into
mainfrom
copilot/move-shared-iobjectnodewithalignment

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

This change removes the duplicate IObjectNodeWithAlignment definitions introduced after #129966 and restores a single shared contract for both AOT compiler projects.

  • Shared interface

    • Moves IObjectNodeWithAlignment to src/coreclr/tools/Common/Compiler/DependencyAnalysis/IObjectNodeWithAlignment.cs
    • Uses namespace ILCompiler.DependencyAnalysis, matching the surrounding shared dependency-analysis surface
    • Preserves the XML doc contract that GetAlignment must stay consistent with GetData / GetDehydratableData
  • Project file cleanup

    • Updates ILCompiler.Compiler.csproj and ILCompiler.ReadyToRun.csproj to compile the shared Common file
    • Removes the two project-local interface entries
  • Consumer impact

    • ReadyToRun now consumes the shared interface through the common namespace instead of a project-local duplicate
    • Existing implementations continue to compile against a single definition without changing behavior
namespace ILCompiler.DependencyAnalysis
{
    public interface IObjectNodeWithAlignment
    {
        int GetAlignment(NodeFactory factory);
    }
}

Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
Copilot AI requested review from Copilot and removed request for Copilot July 8, 2026 00:55
Copilot AI changed the title [WIP] Deduplicate IObjectNodeWithAlignment files into Common directory Deduplicate IObjectNodeWithAlignment into shared Common dependency analysis Jul 8, 2026
Copilot AI requested a review from MichalStrehovsky July 8, 2026 00:56
@jkotas jkotas marked this pull request as ready for review July 8, 2026 02:31
Copilot AI review requested due to automatic review settings July 8, 2026 02:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR consolidates the IObjectNodeWithAlignment interface into the shared CoreCLR tooling “Common” dependency-analysis source set, removing the duplicated per-project definitions and keeping a single canonical contract for both ILCompiler tool projects.

Changes:

  • Add shared ILCompiler.DependencyAnalysis.IObjectNodeWithAlignment under src/coreclr/tools/Common/Compiler/DependencyAnalysis/.
  • Update ILCompiler.Compiler.csproj and ILCompiler.ReadyToRun.csproj to compile/link the shared file.
  • Remove the ReadyToRun-local duplicate interface source entry (and delete the duplicate file).

Reviewed changes

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

File Description
src/coreclr/tools/Common/Compiler/DependencyAnalysis/IObjectNodeWithAlignment.cs Adds the shared interface (and XML doc contract) in the common dependency-analysis namespace.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/ILCompiler.ReadyToRun.csproj Links the shared interface file and removes the ReadyToRun-local compile item.
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/DependencyAnalysis/ReadyToRun/IObjectNodeWithAlignment.cs Deletes the ReadyToRun-local duplicate interface definition.
src/coreclr/tools/aot/ILCompiler.Compiler/ILCompiler.Compiler.csproj Links the shared interface file and removes the project-local compile item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

4 participants