2005-10-16 13:39:50 +08:00
|
|
|
//===-- PPCFrameInfo.h - Define TargetFrameInfo for PowerPC -----*- C++ -*-===//
|
2005-04-22 07:30:14 +08:00
|
|
|
//
|
2004-08-15 06:16:36 +08:00
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file was developed by the LLVM research group and is distributed under
|
|
|
|
// the University of Illinois Open Source License. See LICENSE.TXT for details.
|
2005-04-22 07:30:14 +08:00
|
|
|
//
|
2004-08-15 06:16:36 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
//
|
2005-10-16 13:39:50 +08:00
|
|
|
//===----------------------------------------------------------------------===//
|
2004-08-15 06:16:36 +08:00
|
|
|
|
|
|
|
#ifndef POWERPC_FRAMEINFO_H
|
|
|
|
#define POWERPC_FRAMEINFO_H
|
|
|
|
|
2005-10-15 07:51:18 +08:00
|
|
|
#include "PPC.h"
|
2004-08-15 06:16:36 +08:00
|
|
|
#include "llvm/Target/TargetFrameInfo.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
2005-10-16 13:39:50 +08:00
|
|
|
class PPCFrameInfo: public TargetFrameInfo {
|
2004-08-15 06:16:36 +08:00
|
|
|
const TargetMachine &TM;
|
|
|
|
std::pair<unsigned, int> LR[1];
|
2005-04-22 07:30:14 +08:00
|
|
|
|
2004-08-15 06:16:36 +08:00
|
|
|
public:
|
2005-10-16 13:39:50 +08:00
|
|
|
PPCFrameInfo(const TargetMachine &tm, bool LP64)
|
2004-08-17 13:09:39 +08:00
|
|
|
: TargetFrameInfo(TargetFrameInfo::StackGrowsDown, 16, 0), TM(tm) {
|
2004-08-15 06:16:36 +08:00
|
|
|
LR[0].first = PPC::LR;
|
2004-08-20 05:36:14 +08:00
|
|
|
LR[0].second = LP64 ? 16 : 8;
|
2004-08-15 06:16:36 +08:00
|
|
|
}
|
|
|
|
|
2004-08-15 17:18:55 +08:00
|
|
|
const std::pair<unsigned, int> *
|
2004-08-15 06:16:36 +08:00
|
|
|
getCalleeSaveSpillSlots(unsigned &NumEntries) const {
|
|
|
|
NumEntries = 1;
|
2004-08-16 13:09:58 +08:00
|
|
|
return &LR[0];
|
2004-08-15 06:16:36 +08:00
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
} // End llvm namespace
|
|
|
|
|
|
|
|
#endif
|