-
Notifications
You must be signed in to change notification settings - Fork 5k
Delete unused native code in src/native #67087
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
Conversation
I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/runtime-infrastructure Issue Detailsnull
|
I'm fine with the PAL changes but not sure about the corehost/eventpipe ones so I'll let the others chime in. |
@@ -15,12 +15,10 @@ struct version_t | |||
int get_major() const { return m_major; } | |||
int get_minor() const { return m_minor; } | |||
int get_build() const { return m_build; } | |||
int get_revision() const { return m_revision; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/cc @elinor-fung @vitek-karas for corehost
sub-dir.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
corehost
looks good to me - minor suggestion for possibly deleting some more code.
|
||
void set_major(int m) { m_major = m; } | ||
void set_minor(int m) { m_minor = m; } | ||
void set_build(int m) { m_build = m; } | ||
void set_revision(int m) { m_revision = m; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can actually remove all the set_*
in version_t
and fx_ver_t
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For the EventPipe changes, most of these are utility/library functions and some where original part of the ported C++ library and have been used on and off in the codebase over years, I still see potential value in some of them and they are all static inline, so might end up as unused static function in compile unit and removed by linker. No problem removing them, but I also don't see the problem having them around, or does it trigger some unused code warnings?
We usually delete the code which is unused. We can always bring it back if needed (which seldom happens). |
If this is inline with some best practices I won't object to the changes. Once the code gets removed I believe it will be hard for people not directly involved in the removal to start look for an old removed function that they don't know exists, so I guess it will result in rewriting the code, but since the above is mainly wrappers to handle types more cleaner from caller, they are quick and simple to rewrite. |
Since this is version controlled, we can use Discovering functions that exist is also hard. We deleted redundant utility functions, macros etc. in the past. Those existed because de-duplication aspect is often missed during the development and review. I have found plenty of unused code in src/mono, that is unlinked, has no more than one occurrence in the entire repository (and those functions are without |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thank you!
* Delete unused native code in src/native * Delete set_* functions from version types
No description provided.