Some code cleanups from Chris
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Mon, 23 Feb 2004 01:57:39 +0000 (01:57 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Mon, 23 Feb 2004 01:57:39 +0000 (01:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11724 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PhysRegTracker.h

index d2ff82a237d59b7a59b9caa6a505ced7c1cd7f98..777c3358f27eb11d30919da9390354875b34581e 100644 (file)
 #define LLVM_CODEGEN_PHYSREGTRACKER_H
 
 #include "llvm/CodeGen/MachineFunction.h"
-#include <vector>
 
 namespace llvm {
 
     class PhysRegTracker {
-    private:
         const MRegisterInfo* mri_;
         std::vector<unsigned> regUse_;
 
@@ -50,10 +48,8 @@ namespace llvm {
             assert(MRegisterInfo::isPhysicalRegister(physReg) &&
                    "should be physical register!");
             ++regUse_[physReg];
-            for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as) {
-                physReg = *as;
-                ++regUse_[physReg];
-            }
+            for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as)
+                ++regUse_[*as];
         }
 
         void delRegUse(unsigned physReg) {
@@ -62,9 +58,8 @@ namespace llvm {
             assert(regUse_[physReg] != 0);
             --regUse_[physReg];
             for (const unsigned* as = mri_->getAliasSet(physReg); *as; ++as) {
-                physReg = *as;
-                assert(regUse_[physReg] != 0);
-                --regUse_[physReg];
+                assert(regUse_[*as] != 0);
+                --regUse_[*as];
             }
         }