Make this compile on gc 3.4.1 (static_cast to non-const type was not
authorAlkis Evlogimenos <alkis@evlogimenos.com>
Sun, 15 Aug 2004 09:18:55 +0000 (09:18 +0000)
committerAlkis Evlogimenos <alkis@evlogimenos.com>
Sun, 15 Aug 2004 09:18:55 +0000 (09:18 +0000)
allowed).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15766 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Target/TargetFrameInfo.h
lib/CodeGen/PrologEpilogInserter.cpp
lib/Target/PowerPC/PPCFrameInfo.h

index c727561ab2a7e52d866636cbc6b439f2eb240fcf..dfdca8dab7710af0dea900fbe13cfc88ce4857cb 100644 (file)
@@ -67,7 +67,7 @@ public:
   /// spilled at.  If a register is not listed here, the code generator is
   /// allowed to spill it anywhere it chooses.
   /// 
-  virtual std::pair<unsigned, int> *
+  virtual const std::pair<unsigned, int> *
   getCalleeSaveSpillSlots(unsigned &NumEntries) const {
     NumEntries = 0;
     return 0;
index 20442129650444c9de55adb35bb943fa5a5413b6..1a07013ac3080d1c6ce6e3860eb22df5c489e7c4 100644 (file)
@@ -163,7 +163,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
     return;   // Early exit if no caller saved registers are modified!
 
   unsigned NumFixedSpillSlots;
-  std::pair<unsigned,int> *FixedSpillSlots =
+  const std::pair<unsigned,int> *FixedSpillSlots =
     TFI->getCalleeSaveSpillSlots(NumFixedSpillSlots);
 
   // Now that we know which registers need to be saved and restored, allocate
@@ -175,7 +175,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) {
 
     // Check to see if this physreg must be spilled to a particular stack slot
     // on this target.
-    std::pair<unsigned,int> *FixedSlot = FixedSpillSlots;
+    const std::pair<unsigned,int> *FixedSlot = FixedSpillSlots;
     while (FixedSlot != FixedSpillSlots+NumFixedSpillSlots &&
            FixedSlot->first != Reg)
       ++FixedSlot;
index ba6209fac5f3c1bd2fb731e5c667e5cd2b90951d..c72da9ad26a5e887ece59ed36ec338d9fd3a2274 100644 (file)
@@ -33,10 +33,10 @@ public:
     LR[0].second = 8;
   }
 
-  std::pair<unsigned, int> *
+  const std::pair<unsigned, int> *
   getCalleeSaveSpillSlots(unsigned &NumEntries) const {
     NumEntries = 1;
-    return static_cast<std::pair<unsigned, int> *>(LR);
+    return static_cast<const std::pair<unsigned, int> *>(LR);
   }
 };