| 1 |
.. title:: clang-tidy - llvm-prefer-register-over-unsigned |
| 2 |
|
| 3 |
llvm-prefer-register-over-unsigned |
| 4 |
================================== |
| 5 |
|
| 6 |
Finds historical use of ``unsigned`` to hold vregs and physregs and rewrites |
| 7 |
them to use ``Register``. |
| 8 |
|
| 9 |
Currently this works by finding all variables of unsigned integer type whose |
| 10 |
initializer begins with an implicit cast from ``Register`` to ``unsigned``. |
| 11 |
|
| 12 |
.. code-block:: c++ |
| 13 |
|
| 14 |
void example(MachineOperand &MO) { |
| 15 |
unsigned Reg = MO.getReg(); |
| 16 |
... |
| 17 |
} |
| 18 |
|
| 19 |
becomes: |
| 20 |
|
| 21 |
.. code-block:: c++ |
| 22 |
|
| 23 |
void example(MachineOperand &MO) { |
| 24 |
Register Reg = MO.getReg(); |
| 25 |
... |
| 26 |
} |
| 27 |
|