Deduplicate IObjectNodeWithAlignment into shared Common dependency analysis - #130325
#130325Deduplicate IObjectNodeWithAlignment into shared Common dependency analysis#130325MichalStrehovsky merged 2 commits intomaindotnet/runtime:mainfrom copilot/move-shared-iobjectnodewithalignmentdotnet/runtime:copilot/move-shared-iobjectnodewithalignmentCopy head branch name to clipboard
Conversation
Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
There was a problem hiding this comment.
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.IObjectNodeWithAlignmentundersrc/coreclr/tools/Common/Compiler/DependencyAnalysis/. - Update
ILCompiler.Compiler.csprojandILCompiler.ReadyToRun.csprojto 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. |
|
@dotnet/ilc-contrib could someone give a rubber stamp please? This is my PR and Jan changed it from Draft to Ready and that makes his approval not sufficient for whatever crazy reason. |
Or @EgorBo |
…alysis (#130325) 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 ```csharp namespace ILCompiler.DependencyAnalysis { public interface IObjectNodeWithAlignment { int GetAlignment(NodeFactory factory); } } ``` --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MichalStrehovsky <13110571+MichalStrehovsky@users.noreply.github.com>
This change removes the duplicate
IObjectNodeWithAlignmentdefinitions introduced after #129966 and restores a single shared contract for both AOT compiler projects.Shared interface
IObjectNodeWithAlignmenttosrc/coreclr/tools/Common/Compiler/DependencyAnalysis/IObjectNodeWithAlignment.csnamespace ILCompiler.DependencyAnalysis, matching the surrounding shared dependency-analysis surfaceGetAlignmentmust stay consistent withGetData/GetDehydratableDataProject file cleanup
ILCompiler.Compiler.csprojandILCompiler.ReadyToRun.csprojto compile the shared Common fileConsumer impact