summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Sanders <daniel_l_sanders@apple.com>2019-08-05 21:34:45 +0000
committerDaniel Sanders <daniel_l_sanders@apple.com>2019-08-05 21:34:45 +0000
commiteac86ec25f5cd5d7a973c913d3c2ca8c90b24115 (patch)
treea8e3f360b91bac94a298357fb1bf162e1fccf17c
parent924d2138fce43e9bcca98d06dccad28927d74c26 (diff)
downloadbcm5719-llvm-eac86ec25f5cd5d7a973c913d3c2ca8c90b24115.tar.gz
bcm5719-llvm-eac86ec25f5cd5d7a973c913d3c2ca8c90b24115.zip
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) llvm-svn: 367932
-rw-r--r--llvm/include/llvm/CodeGen/Register.h13
-rw-r--r--llvm/include/llvm/MC/MCRegister.h13
-rw-r--r--llvm/lib/CodeGen/MachineBasicBlock.cpp2
3 files changed, 1 insertions, 27 deletions
diff --git a/llvm/include/llvm/CodeGen/Register.h b/llvm/include/llvm/CodeGen/Register.h
index 73bca60ffcb..640bd82bde2 100644
--- a/llvm/include/llvm/CodeGen/Register.h
+++ b/llvm/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
diff --git a/llvm/include/llvm/MC/MCRegister.h b/llvm/include/llvm/MC/MCRegister.h
index 2d4ac211f09..0e889c7adf7 100644
--- a/llvm/include/llvm/MC/MCRegister.h
+++ b/llvm/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
diff --git a/llvm/lib/CodeGen/MachineBasicBlock.cpp b/llvm/lib/CodeGen/MachineBasicBlock.cpp
index 46146bcfaad..d7e83286b59 100644
--- a/llvm/lib/CodeGen/MachineBasicBlock.cpp
+++ b/llvm/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.");
OpenPOWER on IntegriCloud