Jelajahi Sumber

Revert Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC

MSVC finds ambiguity where clang doesn't and it looks like it's not going to be an easy fix
Reverting while I figure out how to fix it

This reverts r367916 (git commit aa15ec3c231717826e3c262b5ef9813d2fb5cadb)
This reverts r367920 (git commit 5d14efe279b5db9f4746ff834ab5c70e249d3871)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@367932 91177308-0d34-0410-b5e6-96231b3b80d8
Daniel Sanders 6 tahun lalu
induk
melakukan
ecb3f57911

+ 0 - 13
include/llvm/CodeGen/Register.h

@@ -113,19 +113,6 @@ public:
   bool isValid() const {
     return Reg != 0;
   }
-
-  /// Comparisons between register objects
-  bool operator==(const Register &Other) const { return Reg == Other.Reg; }
-  bool operator!=(const Register &Other) const { return Reg != Other.Reg; }
-
-  /// Comparisons against register constants. E.g.
-  /// * R == AArch64::WZR
-  /// * R == 0
-  /// * R == VirtRegMap::NO_PHYS_REG
-  bool operator==(unsigned Other) const { return Reg == Other; }
-  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); }
 };
 
 // Provide DenseMapInfo for Register

+ 0 - 13
include/llvm/MC/MCRegister.h

@@ -63,19 +63,6 @@ public:
   bool isValid() const {
     return Reg != 0;
   }
-
-  /// Comparisons between register objects
-  bool operator==(const MCRegister &Other) const { return Reg == Other.Reg; }
-  bool operator!=(const MCRegister &Other) const { return Reg != Other.Reg; }
-
-  /// Comparisons against register constants. E.g.
-  /// * R == AArch64::WZR
-  /// * R == 0
-  /// * R == VirtRegMap::NO_PHYS_REG
-  bool operator==(unsigned Other) const { return Reg == Other; }
-  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); }
 };
 
 // Provide DenseMapInfo for MCRegister

+ 1 - 1
lib/CodeGen/MachineBasicBlock.cpp

@@ -499,7 +499,7 @@ MachineBasicBlock::addLiveIn(MCPhysReg PhysReg, const TargetRegisterClass *RC) {
   // Look for an existing copy.
   if (LiveIn)
     for (;I != E && I->isCopy(); ++I)
-      if (I->getOperand(1).getReg() == Register(PhysReg)) {
+      if (I->getOperand(1).getReg() == PhysReg) {
         unsigned VirtReg = I->getOperand(0).getReg();
         if (!MRI.constrainRegClass(VirtReg, RC))
           llvm_unreachable("Incompatible live-in register class.");