Make MIRType an enum class

RESOLVED FIXED in Firefox 49

Status

()

defect
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: jandem, Assigned: jandem)

Tracking

unspecified
mozilla49
Points:
---

Firefox Tracking Flags

(firefox49 fixed)

Details

Attachments

(1 attachment)

Assignee

Description

3 years ago
Posted patch PatchSplinter Review
The attached patch makes MIRType an enum class. 

We currently use a MIRType_ prefix for the enum values, so the difference is small (MIRType_Int32 -> MIRType::Int32). The main advantage here is better type safety.

There were ~2 places in IonTypes.h where I had to cast a MIRType to unsigned but other than that everything compiled fine after a global search-and-replace.
Attachment #8744923 - Flags: review?(bbouvier)
Comment on attachment 8744923 [details] [diff] [review]
Patch

Review of attachment 8744923 [details] [diff] [review]:
-----------------------------------------------------------------

Heroic! Thanks a lot for doing that.

Methodology for reviewing:
- apply the sed line, on the same parent revision
- commit
- diff the exported patches to see the differences

For what it's worth, the sed line I've used was:

for f in **/*.{h,cpp}; do mv $f $f.old; sed 's/MIRType_/MIRType::/g' $f.old > $f; rm -f $f.old; done
Attachment #8744923 - Flags: review?(bbouvier) → review+

Comment 3

3 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/b940a11bc559
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Target Milestone: mozilla48 → mozilla49
You need to log in before you can comment on or make changes to this bug.