constify accessor.
authorChris Lattner <sabre@nondot.org>
Fri, 21 May 2010 17:47:50 +0000 (17:47 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 21 May 2010 17:47:50 +0000 (17:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104325 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/CodeGen/MachineRegisterInfo.h
lib/CodeGen/PreAllocSplitting.cpp

index fd7431ff0bcbdcd8f98986b7da6f2307a2cecab8..dede05f85c0f27d20586726e4df78d8660d8e7d0 100644 (file)
@@ -216,7 +216,8 @@ public:
 
   /// getRegClassVirtRegs - Return the list of virtual registers of the given
   /// target register class.
-  std::vector<unsigned> &getRegClassVirtRegs(const TargetRegisterClass *RC) {
+  const std::vector<unsigned> &
+  getRegClassVirtRegs(const TargetRegisterClass *RC) const {
     return RegClass2VRegMap[RC->getID()];
   }
 
index eb19be12ceebe90c1b6ddf8284f207631698c987..997e82f11db747a8e8832160cf4b2d848a29a72e 100644 (file)
@@ -1154,7 +1154,7 @@ PreAllocSplitting::SplitRegLiveIntervals(const TargetRegisterClass **RCs,
     // codegen is not modelling. Ignore these barriers for now.
     if (!TII->isSafeToMoveRegClassDefs(*RC))
       continue;
-    std::vector<unsigned> &VRs = MRI->getRegClassVirtRegs(*RC);
+    const std::vector<unsigned> &VRs = MRI->getRegClassVirtRegs(*RC);
     for (unsigned i = 0, e = VRs.size(); i != e; ++i) {
       unsigned Reg = VRs[i];
       if (!LIs->hasInterval(Reg))