Minor update to IR Statistics#593
Merged
janniclas merged 1 commit intodevelopmentfrom Feb 25, 2023
Merged
Conversation
fabianbs96
approved these changes
Feb 25, 2023
| << "Functions:\t" << Statistics.Functions << "\n" | ||
| << "Global Variables:\t" << Statistics.Globals << "\n" | ||
| << "Global Variable Consts:\t" << Statistics.GlobalConsts << "\n" | ||
| << "Global Pointers:\t" << Statistics.GlobalPointers << "\n" |
Member
There was a problem hiding this comment.
This seems to be redundant. All globals are of pointer type by construction
Member
Author
There was a problem hiding this comment.
agreed. however, the code to set these counters where here before and I didn't want to remove it because I was not sure if someone uses it with exactly this output.
if (Global.getType()->isPointerTy()) {
++Stats.GlobalPointers;
}
++Stats.Globals;
We can definitely remove this but I didn't want to sneak it in here to keep it clear, I just added it to the output to make it more transparent that this exists.
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.
Including a counter for global constants (seems like u were right @fabianbs96 , most of the globals generated in Swift-based LLVM IR are consts and can be ignored for most cases :) )