2012-02-18 20:03:15 +08:00
|
|
|
//===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===//
|
2011-12-20 10:50:00 +08: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 07:29:49 +08:00
|
|
|
#include "llvm/IR/DataLayout.h"
|
|
|
|
#include "llvm/MC/MCContext.h"
|
|
|
|
#include "llvm/Target/TargetMachine.h"
|
2014-08-05 05:25:23 +08:00
|
|
|
#include "llvm/Target/TargetSubtargetInfo.h"
|
2011-12-20 10:50:00 +08:00
|
|
|
|
|
|
|
using namespace llvm;
|
|
|
|
|
|
|
|
void PPCFunctionInfo::anchor() { }
|
|
|
|
|
2014-07-19 07:29:49 +08:00
|
|
|
MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const {
|
2015-07-16 14:11:10 +08:00
|
|
|
const DataLayout &DL = MF.getDataLayout();
|
|
|
|
return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
|
2015-01-27 03:03:15 +08:00
|
|
|
Twine(MF.getFunctionNumber()) +
|
|
|
|
"$poff");
|
2014-07-19 07:29:49 +08:00
|
|
|
}
|