From 4922e2e8ef304cd79adbc556a889cdf5b2b0026f Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 15 Aug 2004 09:18:55 +0000 Subject: [PATCH] Make this compile on gc 3.4.1 (static_cast to non-const type was not allowed). llvm-svn: 15766 --- llvm/include/llvm/Target/TargetFrameInfo.h | 2 +- llvm/lib/CodeGen/PrologEpilogInserter.cpp | 4 ++-- llvm/lib/Target/PowerPC/PowerPCFrameInfo.h | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/llvm/include/llvm/Target/TargetFrameInfo.h b/llvm/include/llvm/Target/TargetFrameInfo.h index c727561ab2a7..dfdca8dab771 100644 --- a/llvm/include/llvm/Target/TargetFrameInfo.h +++ b/llvm/include/llvm/Target/TargetFrameInfo.h @@ -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 * + virtual const std::pair * getCalleeSaveSpillSlots(unsigned &NumEntries) const { NumEntries = 0; return 0; diff --git a/llvm/lib/CodeGen/PrologEpilogInserter.cpp b/llvm/lib/CodeGen/PrologEpilogInserter.cpp index 204421296504..1a07013ac308 100644 --- a/llvm/lib/CodeGen/PrologEpilogInserter.cpp +++ b/llvm/lib/CodeGen/PrologEpilogInserter.cpp @@ -163,7 +163,7 @@ void PEI::calculateCallerSavedRegisters(MachineFunction &Fn) { return; // Early exit if no caller saved registers are modified! unsigned NumFixedSpillSlots; - std::pair *FixedSpillSlots = + const std::pair *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 *FixedSlot = FixedSpillSlots; + const std::pair *FixedSlot = FixedSpillSlots; while (FixedSlot != FixedSpillSlots+NumFixedSpillSlots && FixedSlot->first != Reg) ++FixedSlot; diff --git a/llvm/lib/Target/PowerPC/PowerPCFrameInfo.h b/llvm/lib/Target/PowerPC/PowerPCFrameInfo.h index ba6209fac5f3..c72da9ad26a5 100644 --- a/llvm/lib/Target/PowerPC/PowerPCFrameInfo.h +++ b/llvm/lib/Target/PowerPC/PowerPCFrameInfo.h @@ -33,10 +33,10 @@ public: LR[0].second = 8; } - std::pair * + const std::pair * getCalleeSaveSpillSlots(unsigned &NumEntries) const { NumEntries = 1; - return static_cast *>(LR); + return static_cast *>(LR); } };