Pass in Calling Convention to use into LowerCallTo
[oota-llvm.git] / lib / Target / Skeleton / SkeletonRegisterInfo.cpp
1 //===- SkeletonRegisterInfo.cpp - Skeleton Register Information -*- 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 // This file contains the Skeleton implementation of the MRegisterInfo class.
11 //
12 //===----------------------------------------------------------------------===//
13
14 #include "Skeleton.h"
15 #include "SkeletonRegisterInfo.h"
16 #include "llvm/Type.h"
17 using namespace llvm;
18
19 SkeletonRegisterInfo::SkeletonRegisterInfo()
20   : SkeletonGenRegisterInfo(Skeleton::ADJCALLSTACKDOWN,
21                            Skeleton::ADJCALLSTACKUP) {}
22
23 void SkeletonRegisterInfo::
24 storeRegToStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
25                     unsigned SrcReg, int FrameIdx) const {
26   abort();
27 }
28
29 void SkeletonRegisterInfo::
30 loadRegFromStackSlot(MachineBasicBlock &MBB, MachineBasicBlock::iterator MBBI,
31                      unsigned DestReg, int FrameIdx) const {
32   abort();
33 }
34
35 void SkeletonRegisterInfo::copyRegToReg(MachineBasicBlock &MBB,
36                                         MachineBasicBlock::iterator MBBI,
37                                         unsigned DestReg, unsigned SrcReg,
38                                         const TargetRegisterClass *RC) const {
39   abort();
40 }
41
42 void SkeletonRegisterInfo::
43 eliminateCallFramePseudoInstr(MachineFunction &MF, MachineBasicBlock &MBB,
44                               MachineBasicBlock::iterator I) const {
45   abort();
46 }
47
48 void SkeletonRegisterInfo::eliminateFrameIndex(MachineBasicBlock::iterator II)
49   const {
50   abort();
51 }
52
53 void SkeletonRegisterInfo::
54 processFunctionBeforeFrameFinalized(MachineFunction &MF) const {
55   abort();
56 }
57
58 void SkeletonRegisterInfo::emitPrologue(MachineFunction &MF) const {
59   abort();
60 }
61
62 void SkeletonRegisterInfo::emitEpilogue(MachineFunction &MF,
63                                         MachineBasicBlock &MBB) const {
64   abort();
65 }
66
67
68 #include "SkeletonGenRegisterInfo.inc"
69
70 const TargetRegisterClass*
71 SkeletonRegisterInfo::getRegClassForType(const Type* Ty) const {
72   switch (Ty->getTypeID()) {
73   case Type::LongTyID:
74   case Type::ULongTyID: assert(0 && "Long values can't fit in registers!");
75   default:              assert(0 && "Invalid type to getClass!");
76   case Type::BoolTyID:
77   case Type::SByteTyID:
78   case Type::UByteTyID:
79   case Type::ShortTyID:
80   case Type::UShortTyID:
81   case Type::IntTyID:
82   case Type::UIntTyID:
83   case Type::PointerTyID: return &GPRCInstance;
84
85   case Type::FloatTyID:
86   case Type::DoubleTyID: return &FPRCInstance;
87   }
88 }
89