Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 1 | //===-- PowerPCFrameInfo.h - Define TargetFrameInfo for PowerPC -*- C++ -*-===// |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 2 | // |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file was developed by the LLVM research group and is distributed under |
| 6 | // the University of Illinois Open Source License. See LICENSE.TXT for details. |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 7 | // |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //---------------------------------------------------------------------------- |
| 12 | |
| 13 | #ifndef POWERPC_FRAMEINFO_H |
| 14 | #define POWERPC_FRAMEINFO_H |
| 15 | |
Chris Lattner | 2668959 | 2005-10-14 23:51:18 +0000 | [diff] [blame^] | 16 | #include "PPC.h" |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 17 | #include "llvm/Target/TargetFrameInfo.h" |
| 18 | #include "llvm/Target/TargetMachine.h" |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 19 | |
| 20 | namespace llvm { |
| 21 | |
| 22 | class PowerPCFrameInfo: public TargetFrameInfo { |
| 23 | const TargetMachine &TM; |
| 24 | std::pair<unsigned, int> LR[1]; |
Misha Brukman | b5f662f | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 25 | |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 26 | public: |
Misha Brukman | 983e92d | 2004-08-19 21:36:14 +0000 | [diff] [blame] | 27 | PowerPCFrameInfo(const TargetMachine &tm, bool LP64) |
Misha Brukman | 6316181 | 2004-08-17 05:09:39 +0000 | [diff] [blame] | 28 | : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(tm) { |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 29 | LR[0].first = PPC::LR; |
Misha Brukman | 983e92d | 2004-08-19 21:36:14 +0000 | [diff] [blame] | 30 | LR[0].second = LP64 ? 16 : 8; |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 31 | } |
| 32 | |
Alkis Evlogimenos | 8c9b4de | 2004-08-15 09:18:55 +0000 | [diff] [blame] | 33 | const std::pair<unsigned, int> * |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 34 | getCalleeSaveSpillSlots(unsigned &NumEntries) const { |
| 35 | NumEntries = 1; |
Chris Lattner | b648206 | 2004-08-16 05:09:58 +0000 | [diff] [blame] | 36 | return &LR[0]; |
Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 37 | } |
| 38 | }; |
| 39 | |
| 40 | } // End llvm namespace |
| 41 | |
| 42 | #endif |