Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
llvm/include/llvm/MC/MCRegister.h | ||
---|---|---|
23–29 | Do you need to touch MCRegister.h? There is already an introductory comment like this near the definition of MCRegUnitIterator in MCRegisterInfo.h. |
llvm/include/llvm/MC/MCRegister.h | ||
---|---|---|
23–29 | I've always been confused by register units and their difference from physical registers. I'm hoping to turn this typedef into a class for stricter type checking some day. |
llvm/include/llvm/MC/MCRegisterInfo.h | ||
---|---|---|
250 | There is indeed code duplication between mc_*_iterator and MC*Iterator classes. AIUI MC version was supposed to replace mc_ version eventually. |
llvm/include/llvm/MC/MCRegister.h | ||
---|---|---|
23–29 | Sure. The only thing I don't like is having two different introductory comments in two different places. |
- Move the comment about register units to MCRegister.h
- Add const to iterator value type so that operator-> works
llvm/include/llvm/MC/MCRegister.h | ||
---|---|---|
23–29 | I've moved the comment from MCRegisterInfo.h here as is. |
I think this is a great readability improvement. Thanks! How close are we to being able to remove the old MCRegUnitIterator?
How close are we to being able to remove the old MCRegUnitIterator?
Sorry, I misunderstood. You are not adding a new regunit iterator, so there is no "old" one to remove.
I am guessing you meant getting rid of the old approach -- constructing an iterator directly from Reg and TRI
and calling isValid() for determining whether we can iterate further. That is, make the iterators more STL-like.
There is only a dozen of such uses left, half of them in MachineCopyPropagation.cpp.
I didn't address them in this patch because they require non-straightforward changes.
Do you need to touch MCRegister.h? There is already an introductory comment like this near the definition of MCRegUnitIterator in MCRegisterInfo.h.