Improved PhysRegTracker interface. RegAlloc lazily allocates the register tracker using a std::auto_ptr

llvm-svn: 11738
diff --git a/llvm/lib/CodeGen/PhysRegTracker.h b/llvm/lib/CodeGen/PhysRegTracker.h
index 777c335..f5a2402 100644
--- a/llvm/lib/CodeGen/PhysRegTracker.h
+++ b/llvm/lib/CodeGen/PhysRegTracker.h
@@ -17,7 +17,7 @@
 #ifndef LLVM_CODEGEN_PHYSREGTRACKER_H
 #define LLVM_CODEGEN_PHYSREGTRACKER_H
 
-#include "llvm/CodeGen/MachineFunction.h"
+#include "llvm/Target/MRegisterInfo.h"
 
 namespace llvm {
 
@@ -26,11 +26,9 @@
         std::vector<unsigned> regUse_;
 
     public:
-        PhysRegTracker(MachineFunction* mf)
-            : mri_(mf ? mf->getTarget().getRegisterInfo() : NULL) {
-            if (mri_) {
-                regUse_.assign(mri_->getNumRegs(), 0);
-            }
+        PhysRegTracker(const MRegisterInfo& mri)
+            : mri_(&mri),
+              regUse_(mri_->getNumRegs(), 0) {
         }
 
         PhysRegTracker(const PhysRegTracker& rhs)