make sure to safe LR8 in the right stack slot for PPC64
authorChris Lattner <sabre@nondot.org>
Sat, 18 Nov 2006 01:34:43 +0000 (01:34 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 18 Nov 2006 01:34:43 +0000 (01:34 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31839 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/PowerPC/PPCFrameInfo.h
lib/Target/PowerPC/PPCTargetMachine.cpp

index ed67496e55d80c539888e14cd5aeabfef49477bb..1330034f5ad1c97406c0b299aa34939415c5a9eb 100644 (file)
@@ -26,8 +26,13 @@ class PPCFrameInfo: public TargetFrameInfo {
 public:
   PPCFrameInfo(const TargetMachine &tm, bool LP64)
     : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(tm) {
-    LR[0].first = PPC::LR;
-    LR[0].second = LP64 ? 16 : 8;
+    if (LP64) {
+      LR[0].first = PPC::LR8;
+      LR[0].second = 16;
+    } else {
+      LR[0].first = PPC::LR;
+      LR[0].second = 8;
+    }
   }
 
   const std::pair<unsigned, int> *
index 954d15c5b69a2fff843c3a0bad2eb985e714c448..dde998f5a7f1e95e8985e3eccc0ecb673f37bf9d 100644 (file)
@@ -83,7 +83,7 @@ PPCTargetMachine::PPCTargetMachine(const Module &M, const std::string &FS,
                                    bool is64Bit)
   : Subtarget(M, FS, is64Bit),
     DataLayout(Subtarget.getTargetDataString()), InstrInfo(*this),
-    FrameInfo(*this, false), JITInfo(*this, is64Bit), TLInfo(*this),
+    FrameInfo(*this, is64Bit), JITInfo(*this, is64Bit), TLInfo(*this),
     InstrItins(Subtarget.getInstrItineraryData()) {
 
   if (getRelocationModel() == Reloc::Default)