DescriptionSubzero: Use a proper RegNumT type instead of int32_t/SizeT.
Originally, register numbers were represented explicitly as int32_t, particularly so that -1 (or negative values in general) could be used as a NoRegister sentinel value. This created two problems:
1. It would be better to use a unique name for the type, to distinguish from other explicit int32_t uses such as stack offsets.
2. Apart from NoRegister, register number values ultimately come from unsigned sources like enum values and bitvector positions. This results in a number of clumsy casts to remove compiler warnings.
This creates a simple RegNumT class to manage this. It also deletes ordered comparison operators to help catch errors where particular register number orderings are assumed (as opposed to orderings of the encoded register values).
In addition, it creates a RegNumBitVector wrapper class that makes it much cleaner to do range-based for loops over bit vectors that represent RegNumT sets.
BUG= none
R=eholk@chromium.org, jpp@chromium.org
Committed: https://gerrit.chromium.org/gerrit/gitweb?p=native_client/pnacl-subzero.git;a=commit;h=8aa396610b7baf728631a43ea16ad3d13e38397a
Patch Set 1 #Patch Set 2 : Minor cleanup #Patch Set 3 : Fix int32_t ==> int for the result of BitVector find_first() and find_next() #
Total comments: 45
Patch Set 4 : Allow only enum-type arguments in the public RegNumT ctor #Patch Set 5 : Refactor limit checks into the RegNumT class #Patch Set 6 : Add the RegNumBitVector adapter class #Patch Set 7 : Use auto instead of explicit RegNumT where appropriate #Patch Set 8 : Revert some method name changes #
Total comments: 15
Patch Set 9 : Add "const" to changes where appropriate #Patch Set 10 : Code review changes #Patch Set 11 : Make it possible to do "auto NewReg = RegNumT::NoRegister;" #
Messages
Total messages: 17 (6 generated)
|