2012-02-18 13:03:15 +01:00
|
|
|
//===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===//
|
2011-12-20 03:50:00 +01:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "PPCMachineFunctionInfo.h"
|
2014-07-19 01:29:49 +02:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
|
|
|
#include "llvm/MC/MCContext.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2014-08-04 23:25:23 +02:00
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2011-12-20 03:50:00 +01:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
void PPCFunctionInfo::anchor() { }
|
|
|
|
|
2014-07-19 01:29:49 +02:00
|
|
|
MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const {
|
2015-07-16 08:11:10 +02:00
|
|
|
const DataLayout &DL = MF.getDataLayout();
|
|
|
|
return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
|
2015-01-26 20:03:15 +01:00
|
|
|
Twine(MF.getFunctionNumber()) +
|
|
|
|
"$poff");
|
2014-07-19 01:29:49 +02:00
|
|
|
}
|
2016-01-13 14:12:23 +01:00
|
|
|
|
|
|
|
MCSymbol *PPCFunctionInfo::getGlobalEPSymbol() const {
|
|
|
|
const DataLayout &DL = MF.getDataLayout();
|
|
|
|
return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
|
|
|
|
"func_gep" +
|
|
|
|
Twine(MF.getFunctionNumber()));
|
|
|
|
}
|
|
|
|
|
|
|
|
MCSymbol *PPCFunctionInfo::getLocalEPSymbol() const {
|
|
|
|
const DataLayout &DL = MF.getDataLayout();
|
|
|
|
return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
|
|
|
|
"func_lep" +
|
|
|
|
Twine(MF.getFunctionNumber()));
|
|
|
|
}
|
|
|
|
|
|
|
|
MCSymbol *PPCFunctionInfo::getTOCOffsetSymbol() const {
|
|
|
|
const DataLayout &DL = MF.getDataLayout();
|
|
|
|
return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
|
|
|
|
"func_toc" +
|
|
|
|
Twine(MF.getFunctionNumber()));
|
|
|
|
}
|