blob: 4aff95a8a65718c967f0b4143fbb2b58c58ed72f [file] [log] [blame]
Jia Liub22310f2012-02-18 12:03:15 +00001//===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===//
David Blaikiea379b1812011-12-20 02:50:00 +00002//
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 "PPCMachineFunctionInfo.h"
Hal Finkel3ee2af72014-07-18 23:29:49 +000011#include "llvm/IR/DataLayout.h"
12#include "llvm/MC/MCContext.h"
13#include "llvm/Target/TargetMachine.h"
Eric Christopherd9134482014-08-04 21:25:23 +000014#include "llvm/Target/TargetSubtargetInfo.h"
David Blaikiea379b1812011-12-20 02:50:00 +000015
16using namespace llvm;
17
18void PPCFunctionInfo::anchor() { }
19
Hal Finkel3ee2af72014-07-18 23:29:49 +000020MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const {
Eric Christopherfc6de422014-08-05 02:39:49 +000021 const DataLayout *DL = MF.getSubtarget().getDataLayout();
Hal Finkel3ee2af72014-07-18 23:29:49 +000022 return MF.getContext().GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+
23 Twine(MF.getFunctionNumber())+"$poff");
24}