forked from Hoernchen/Epiphany
-
Notifications
You must be signed in to change notification settings - Fork 2
/
EpiphanyMachineFunction.cpp
41 lines (32 loc) · 1.27 KB
/
EpiphanyMachineFunction.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//===-- EpiphanyMachineFuctionInfo.cpp - Epiphany machine function info -----===//
//
// The LLVM Compiler Infrastructure
//
// This file is distributed under the University of Illinois Open Source
// License. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
//
// This file just contains the anchor for the EpiphanyMachineFunctionInfo to
// force vtable emission.
//
//===----------------------------------------------------------------------===//
#include "EpiphanyMachineFunction.h"
#include "EpiphanyInstrInfo.h"
#include "EpiphanySubtarget.h"
#include "llvm/IR/Function.h"
#include "llvm/CodeGen/MachineInstrBuilder.h"
#include "llvm/CodeGen/MachineRegisterInfo.h"
using namespace llvm;
bool FixGlobalBaseReg;
EpiphanyMachineFunctionInfo::~EpiphanyMachineFunctionInfo() {}
void EpiphanyMachineFunctionInfo::anchor() { }
unsigned EpiphanyMachineFunctionInfo::getGlobalBaseReg() {
// Return if it has already been initialized.
if (GlobalBaseReg)
return GlobalBaseReg;
EpiphanySubtarget const &STI =
static_cast<const EpiphanySubtarget &>(MF.getSubtarget());
const TargetRegisterClass *RC = &Epiphany::GPR32RegClass;
return GlobalBaseReg = MF.getRegInfo().createVirtualRegister(RC);
}