Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- PPCMachineFunctionInfo.cpp - Private data used for PowerPC --------===// |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 2 | // |
| 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 Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 11 | #include "llvm/IR/DataLayout.h" |
| 12 | #include "llvm/MC/MCContext.h" |
| 13 | #include "llvm/Target/TargetMachine.h" |
Eric Christopher | d913448 | 2014-08-04 21:25:23 +0000 | [diff] [blame] | 14 | #include "llvm/Target/TargetSubtargetInfo.h" |
David Blaikie | a379b181 | 2011-12-20 02:50:00 +0000 | [diff] [blame] | 15 | |
| 16 | using namespace llvm; |
| 17 | |
| 18 | void PPCFunctionInfo::anchor() { } |
| 19 | |
Hal Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 20 | MCSymbol *PPCFunctionInfo::getPICOffsetSymbol() const { |
Eric Christopher | fc6de42 | 2014-08-05 02:39:49 +0000 | [diff] [blame] | 21 | const DataLayout *DL = MF.getSubtarget().getDataLayout(); |
Hal Finkel | 3ee2af7 | 2014-07-18 23:29:49 +0000 | [diff] [blame] | 22 | return MF.getContext().GetOrCreateSymbol(Twine(DL->getPrivateGlobalPrefix())+ |
| 23 | Twine(MF.getFunctionNumber())+"$poff"); |
| 24 | } |