Skip to content
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

Replace PlatformMapper with a function #120

Merged
merged 1 commit into from
Nov 5, 2024

Conversation

Pennycook
Copy link
Contributor

Using the visitor pattern to map platforms is unnecessary, since the mapping code needs to visit every CodeNode in the tree. Iterating through the list of CodeNodes is much more straightforward.

This commit also removes TreeMapper, since PlatformMapper was the only class descended from it.

Related issues

Part of #101.

Proposed changes

  • Replace the PlatformMapper class with a simpler get_setmap() function.
  • Migrate the tests to the new functionality.

While working on this, I realized that "setmap" isn't a very good name, and doesn't really describe what it represents. But I think we should defer that bikeshedding for later.

Using the visitor pattern to map platforms is unnecessary, since the
mapping code needs to visit every CodeNode in the tree. Iterating
through the list of CodeNodes is much more straightforward.

This commit also removes TreeMapper, since PlatformMapper was the only
class descended from it.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the refactor Improvements to code structure label Oct 11, 2024
@Pennycook Pennycook added this to the 2.0.0 milestone Oct 11, 2024
@Pennycook Pennycook merged commit 9231ff8 into intel:main Nov 5, 2024
3 checks passed
@Pennycook Pennycook deleted the platform-mapper branch November 5, 2024 09:35
Pennycook added a commit to Pennycook/code-base-investigator that referenced this pull request Nov 5, 2024
This somehow slipped through the cracks when intel#120 was merged, and wasn't
identified until the CI tests ran on the merge commit.

Signed-off-by: John Pennycook <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Improvements to code structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants