[llvm-commits] CVS: llvm/lib/CodeGen/RegAllocLinearScan.cpp

Alkis Evlogimenos alkis at cs.uiuc.edu
Sun Feb 1 12:41:02 PST 2004


Changes in directory llvm/lib/CodeGen:

RegAllocLinearScan.cpp updated: 1.35 -> 1.36

---
Log message:

Use std::map::count() instead of std::map::find() != std::map::end()
where appropriate.


---
Diffs of the changes:  (+3 -5)

Index: llvm/lib/CodeGen/RegAllocLinearScan.cpp
diff -u llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.35 llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.36
--- llvm/lib/CodeGen/RegAllocLinearScan.cpp:1.35	Sat Jan 31 19:27:01 2004
+++ llvm/lib/CodeGen/RegAllocLinearScan.cpp	Sun Feb  1 12:39:53 2004
@@ -340,13 +340,11 @@
         unsigned rep = li_->rep(reg);
 
         assert((MRegisterInfo::isPhysicalRegister(rep) ||
-                v2pMap_.find(rep) != v2pMap_.end() ||
-                v2ssMap_.find(rep) != v2ssMap_.end()) &&
+                v2pMap_.count(rep) || v2ssMap_.count(rep)) &&
                "representative register is not allocated!");
 
         assert(MRegisterInfo::isVirtualRegister(reg) &&
-               v2pMap_.find(reg) == v2pMap_.end() &&
-               v2ssMap_.find(reg) == v2ssMap_.end() &&
+               !v2pMap_.count(reg) && !v2ssMap_.count(reg) &&
                "coalesced register is already allocated!");
 
         if (MRegisterInfo::isPhysicalRegister(rep)) {
@@ -772,7 +770,7 @@
            "attempt to assign stack slot to already assigned register?");
     // if the virtual register was previously assigned clear the mapping
     // and free the virtual register
-    if (v2pMap_.find(virtReg) != v2pMap_.end()) {
+    if (v2pMap_.count(virtReg)) {
         clearVirtReg(virtReg);
     }
 }





More information about the llvm-commits mailing list