DebugInfo: Refactor index type DIE initialization by rolling it into the accessor
[oota-llvm.git] / lib / Target / Mips / MipsABIInfo.cpp
1 //===---- MipsABIInfo.cpp - Information about MIPS ABI's ------------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 #include "MipsABIInfo.h"
11 #include "MipsRegisterInfo.h"
12
13 using namespace llvm;
14
15 namespace {
16 static const MCPhysReg O32IntRegs[4] = {Mips::A0, Mips::A1, Mips::A2, Mips::A3};
17
18 static const MCPhysReg Mips64IntRegs[8] = {
19     Mips::A0_64, Mips::A1_64, Mips::A2_64, Mips::A3_64,
20     Mips::T0_64, Mips::T1_64, Mips::T2_64, Mips::T3_64};
21 }
22
23 const ArrayRef<MCPhysReg> MipsABIInfo::GetByValArgRegs() const {
24   if (IsO32())
25     return makeArrayRef(O32IntRegs);
26   if (IsN32() || IsN64())
27     return makeArrayRef(Mips64IntRegs);
28   llvm_unreachable("Unhandled ABI");
29 }