blob: 95f163153c744ce98f07b0286e9c83a3e4d79ee8 [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 {
Mehdi Aminibd7287e2015-07-16 06:11:10 +000021 const DataLayout &DL = MF.getDataLayout();
22 return MF.getContext().getOrCreateSymbol(Twine(DL.getPrivateGlobalPrefix()) +
Eric Christopher8b770652015-01-26 19:03:15 +000023 Twine(MF.getFunctionNumber()) +
24 "$poff");
Hal Finkel3ee2af72014-07-18 23:29:49 +000025}