Nate Begeman | ca068e8 | 2004-08-14 22:16:36 +0000 | [diff] [blame^] | 1 | //===-- PowerPCFrameInfo.h - Define TargetFrameInfo for PowerPC -*- C++ -*-===// |
| 2 | // |
| 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. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //---------------------------------------------------------------------------- |
| 12 | |
| 13 | #ifndef POWERPC_FRAMEINFO_H |
| 14 | #define POWERPC_FRAMEINFO_H |
| 15 | |
| 16 | #include "PowerPC.h" |
| 17 | #include "llvm/Target/TargetFrameInfo.h" |
| 18 | #include "llvm/Target/TargetMachine.h" |
| 19 | #include "llvm/Target/MRegisterInfo.h" |
| 20 | #include <map> |
| 21 | |
| 22 | namespace llvm { |
| 23 | |
| 24 | class PowerPCFrameInfo: public TargetFrameInfo { |
| 25 | const TargetMachine &TM; |
| 26 | std::pair<unsigned, int> LR[1]; |
| 27 | |
| 28 | public: |
| 29 | |
| 30 | PowerPCFrameInfo(const TargetMachine &inTM) |
| 31 | : TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(inTM) { |
| 32 | LR[0].first = PPC::LR; |
| 33 | LR[0].second = 8; |
| 34 | } |
| 35 | |
| 36 | std::pair<unsigned, int> * |
| 37 | getCalleeSaveSpillSlots(unsigned &NumEntries) const { |
| 38 | NumEntries = 1; |
| 39 | return static_cast<std::pair<unsigned, int> *>(LR); |
| 40 | } |
| 41 | }; |
| 42 | |
| 43 | } // End llvm namespace |
| 44 | |
| 45 | #endif |