//===-- llvm/CodeGen/SSARegMap.h --------------------------------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
-//
+//
// Map register numbers to register classes that are correctly sized (typed) to
// hold the information. Assists register allocation. Contained by
// MachineFunction, should be deleted by register allocator when it is no
// longer needed.
-//
+//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CODEGEN_SSAREGMAP_H
class SSARegMap {
std::vector<const TargetRegisterClass*> RegClassMap;
- unsigned rescale(unsigned Reg) {
+ unsigned rescale(unsigned Reg) {
return Reg - MRegisterInfo::FirstVirtualRegister;
}
RegClassMap.push_back(RegClass);
return RegClassMap.size()+MRegisterInfo::FirstVirtualRegister-1;
}
+
+ unsigned getNumVirtualRegs() const {
+ return RegClassMap.size();
+ }
};
} // End llvm namespace