| Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 1 | //===-- PPCFrameInfo.h - Define TargetFrameInfo for PowerPC -----*- C++ -*-===// | 
| Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 2 | // | 
| Nate Begeman | 412602d | 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 | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 7 | // | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// | 
|  | 9 | // | 
|  | 10 | // | 
| Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 11 | //===----------------------------------------------------------------------===// | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 12 |  | 
|  | 13 | #ifndef POWERPC_FRAMEINFO_H | 
|  | 14 | #define POWERPC_FRAMEINFO_H | 
|  | 15 |  | 
| Chris Lattner | bfca1ab | 2005-10-14 23:51:18 +0000 | [diff] [blame] | 16 | #include "PPC.h" | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 17 | #include "llvm/Target/TargetFrameInfo.h" | 
|  | 18 | #include "llvm/Target/TargetMachine.h" | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 19 |  | 
|  | 20 | namespace llvm { | 
|  | 21 |  | 
| Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 22 | class PPCFrameInfo: public TargetFrameInfo { | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 23 | const TargetMachine &TM; | 
|  | 24 | std::pair<unsigned, int> LR[1]; | 
| Misha Brukman | b440243 | 2005-04-21 23:30:14 +0000 | [diff] [blame] | 25 |  | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 26 | public: | 
| Nate Begeman | 6cca84e | 2005-10-16 05:39:50 +0000 | [diff] [blame] | 27 | PPCFrameInfo(const TargetMachine &tm, bool LP64) | 
| Misha Brukman | 851a546 | 2004-08-17 05:09:39 +0000 | [diff] [blame] | 28 | : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(tm) { | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 29 | LR[0].first = PPC::LR; | 
| Misha Brukman | f73c87b | 2004-08-19 21:36:14 +0000 | [diff] [blame] | 30 | LR[0].second = LP64 ? 16 : 8; | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 31 | } | 
|  | 32 |  | 
| Alkis Evlogimenos | 4922e2e | 2004-08-15 09:18:55 +0000 | [diff] [blame] | 33 | const std::pair<unsigned, int> * | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 34 | getCalleeSaveSpillSlots(unsigned &NumEntries) const { | 
|  | 35 | NumEntries = 1; | 
| Chris Lattner | f2e9ea2 | 2004-08-16 05:09:58 +0000 | [diff] [blame] | 36 | return &LR[0]; | 
| Nate Begeman | 412602d | 2004-08-14 22:16:36 +0000 | [diff] [blame] | 37 | } | 
|  | 38 | }; | 
|  | 39 |  | 
|  | 40 | } // End llvm namespace | 
|  | 41 |  | 
|  | 42 | #endif |