[PATCH] D65678: Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Aug 4 20:37:58 PDT 2019


arsenm added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/Register.h:127-128
+  bool operator!=(unsigned Other) const { return Reg != Other; }
+  bool operator==(int Other) const { return Reg == unsigned(Other); }
+  bool operator!=(int Other) const { return Reg != unsigned(Other); }
 };
----------------
Why are both the signed and unsigned versions necessary?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D65678/new/

https://reviews.llvm.org/D65678





More information about the llvm-commits mailing list