This is an archive of the discontinued LLVM Phabricator instance.

[llvm-locstats][NFC] Support OOP concept
ClosedPublic

Authored by djtodoro on Dec 25 2019, 12:23 AM.

Details

Summary

Making these changes, the code becomes more robust and easier for adding the new features.

  1. Introduce the LocationStats class representing the statistics
  2. Add the pretty_print() method in the LocationStats class
  3. Add additional '-' for the program options
  4. Add the verify_program_inputs() function
  5. Add the parse_locstats() function
  6. Rename 'results' => 'opts'
  7. Add more comments

Diff Detail

Event Timeline

djtodoro created this revision.Dec 25 2019, 12:23 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 25 2019, 12:23 AM
djtodoro edited the summary of this revision. (Show Details)Dec 25 2019, 12:47 AM
dstenb accepted this revision.Jan 7 2020, 8:56 AM

Seems like a good refactoring. Two minor inline comments.

llvm/utils/llvm-locstats/llvm-locstats.py
33

Should this be a return instead now that this code is moved to a utility function?

76–78

an -> a

This revision is now accepted and ready to land.Jan 7 2020, 8:56 AM

Thanks for the comments! Sorry for the late response, I was on the vacation.

djtodoro updated this revision to Diff 237628.Jan 13 2020, 5:04 AM

-Addressing comments

This revision was automatically updated to reflect the committed changes.