mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-19 18:10:14 +00:00
Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11060 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
e5ec955fa4
commit
f440cc19c9
@ -340,13 +340,11 @@ bool RA::runOnMachineFunction(MachineFunction &fn) {
|
|||||||
unsigned rep = li_->rep(reg);
|
unsigned rep = li_->rep(reg);
|
||||||
|
|
||||||
assert((MRegisterInfo::isPhysicalRegister(rep) ||
|
assert((MRegisterInfo::isPhysicalRegister(rep) ||
|
||||||
v2pMap_.find(rep) != v2pMap_.end() ||
|
v2pMap_.count(rep) || v2ssMap_.count(rep)) &&
|
||||||
v2ssMap_.find(rep) != v2ssMap_.end()) &&
|
|
||||||
"representative register is not allocated!");
|
"representative register is not allocated!");
|
||||||
|
|
||||||
assert(MRegisterInfo::isVirtualRegister(reg) &&
|
assert(MRegisterInfo::isVirtualRegister(reg) &&
|
||||||
v2pMap_.find(reg) == v2pMap_.end() &&
|
!v2pMap_.count(reg) && !v2ssMap_.count(reg) &&
|
||||||
v2ssMap_.find(reg) == v2ssMap_.end() &&
|
|
||||||
"coalesced register is already allocated!");
|
"coalesced register is already allocated!");
|
||||||
|
|
||||||
if (MRegisterInfo::isPhysicalRegister(rep)) {
|
if (MRegisterInfo::isPhysicalRegister(rep)) {
|
||||||
@ -772,7 +770,7 @@ void RA::assignVirt2StackSlot(unsigned virtReg)
|
|||||||
"attempt to assign stack slot to already assigned register?");
|
"attempt to assign stack slot to already assigned register?");
|
||||||
// if the virtual register was previously assigned clear the mapping
|
// if the virtual register was previously assigned clear the mapping
|
||||||
// and free the virtual register
|
// and free the virtual register
|
||||||
if (v2pMap_.find(virtReg) != v2pMap_.end()) {
|
if (v2pMap_.count(virtReg)) {
|
||||||
clearVirtReg(virtReg);
|
clearVirtReg(virtReg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user