blob: 9613b864c6b0a14fcca7576b676625d145fdcd29 [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 Christopherd9134482014-08-04 21:25:23 +000021 const DataLayout *DL = MF.getTarget().getSubtargetImpl()->getDataLayout();
Hal Finkel3ee2af72014-07-18 23:29:49 +000022 return MF.getContext().GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+
23 Twine(MF.getFunctionNumber())+"$poff");
24}