blob: 1555c039c495a74de23ce52e87735e9af79359db [file] [log] [blame]
Chris Lattner5e693ed2009-07-28 03:13:23 +00001//===-- llvm/Target/TargetLoweringObjectFile.cpp - Object File Info -------===//
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// This file implements classes used to handle lowerings specific to common
11// object file formats.
12//
13//===----------------------------------------------------------------------===//
14
15#include "llvm/Target/TargetLoweringObjectFile.h"
Chandler Carruth9fb823b2013-01-02 11:36:10 +000016#include "llvm/IR/Constants.h"
17#include "llvm/IR/DataLayout.h"
18#include "llvm/IR/DerivedTypes.h"
19#include "llvm/IR/Function.h"
20#include "llvm/IR/GlobalVariable.h"
Rafael Espindola894843c2014-01-07 21:19:40 +000021#include "llvm/IR/Mangler.h"
Rafael Espindola117b20c2013-12-05 05:53:12 +000022#include "llvm/MC/MCAsmInfo.h"
Chris Lattner4d2c0f92009-07-31 18:48:30 +000023#include "llvm/MC/MCContext.h"
Chris Lattnerb8666022009-09-16 01:46:41 +000024#include "llvm/MC/MCExpr.h"
Chris Lattner03627cb2010-03-11 21:55:20 +000025#include "llvm/MC/MCStreamer.h"
Chris Lattnerccbeed22010-01-13 21:29:21 +000026#include "llvm/MC/MCSymbol.h"
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +000027#include "llvm/Support/Dwarf.h"
Chris Lattnerd82510e2009-11-07 09:20:54 +000028#include "llvm/Support/ErrorHandling.h"
Chris Lattnerccbeed22010-01-13 21:29:21 +000029#include "llvm/Support/raw_ostream.h"
Rafael Espindoladaeafb42014-02-19 17:23:20 +000030#include "llvm/Target/TargetLowering.h"
Chandler Carruth442f7842014-03-04 10:07:28 +000031#include "llvm/Target/TargetMachine.h"
Chandler Carruthed0881b2012-12-03 16:50:05 +000032#include "llvm/Target/TargetOptions.h"
Eric Christopherd9134482014-08-04 21:25:23 +000033#include "llvm/Target/TargetSubtargetInfo.h"
Chris Lattner5e693ed2009-07-28 03:13:23 +000034using namespace llvm;
35
36//===----------------------------------------------------------------------===//
37// Generic Code
38//===----------------------------------------------------------------------===//
39
Evan Cheng76792992011-07-20 05:58:47 +000040/// Initialize - this method must be called before any actual lowering is
41/// done. This specifies the current context for codegen, and gives the
42/// lowering implementations a chance to set up their default sections.
43void TargetLoweringObjectFile::Initialize(MCContext &ctx,
44 const TargetMachine &TM) {
45 Ctx = &ctx;
Eric Christopher4367c7f2016-09-16 07:33:15 +000046 Mang = new Mangler();
Rafael Espindola444746b2016-06-28 12:25:00 +000047 InitMCObjectFileInfo(TM.getTargetTriple(), TM.isPositionIndependent(),
Daniel Sanders8d8b13d2015-06-16 12:18:07 +000048 TM.getCodeModel(), *Ctx);
Chris Lattner5e693ed2009-07-28 03:13:23 +000049}
Saleem Abdulrasool0d3d6c42014-04-16 04:15:25 +000050
Chris Lattner5e693ed2009-07-28 03:13:23 +000051TargetLoweringObjectFile::~TargetLoweringObjectFile() {
Eric Christopher4367c7f2016-09-16 07:33:15 +000052 delete Mang;
Chris Lattner5e693ed2009-07-28 03:13:23 +000053}
54
Nick Lewycky50f02cb2011-12-02 22:16:29 +000055static bool isSuitableForBSS(const GlobalVariable *GV, bool NoZerosInBSS) {
Jay Foad60020682011-06-19 18:37:11 +000056 const Constant *C = GV->getInitializer();
Anton Korobeynikov1df58862009-09-09 08:41:20 +000057
Chris Lattner5e693ed2009-07-28 03:13:23 +000058 // Must have zero initializer.
59 if (!C->isNullValue())
60 return false;
Anton Korobeynikov1df58862009-09-09 08:41:20 +000061
Chris Lattner5e693ed2009-07-28 03:13:23 +000062 // Leave constant zeros in readonly constant sections, so they can be shared.
63 if (GV->isConstant())
64 return false;
Anton Korobeynikov1df58862009-09-09 08:41:20 +000065
Chris Lattner5e693ed2009-07-28 03:13:23 +000066 // If the global has an explicit section specified, don't put it in BSS.
David Majnemer483e4e02014-05-17 05:18:40 +000067 if (GV->hasSection())
Chris Lattner5e693ed2009-07-28 03:13:23 +000068 return false;
Anton Korobeynikov1df58862009-09-09 08:41:20 +000069
Chris Lattner5e693ed2009-07-28 03:13:23 +000070 // If -nozero-initialized-in-bss is specified, don't ever use BSS.
71 if (NoZerosInBSS)
72 return false;
Anton Korobeynikov1df58862009-09-09 08:41:20 +000073
Chris Lattner5e693ed2009-07-28 03:13:23 +000074 // Otherwise, put it in BSS!
75 return true;
76}
77
Chris Lattner81bbf442009-08-04 16:13:09 +000078/// IsNullTerminatedString - Return true if the specified constant (which is
79/// known to have a type that is an array of 1/2/4 byte elements) ends with a
Chris Lattner139822f2012-01-24 14:17:05 +000080/// nul value and contains no other nuls in it. Note that this is more general
81/// than ConstantDataSequential::isString because we allow 2 & 4 byte strings.
Chris Lattner81bbf442009-08-04 16:13:09 +000082static bool IsNullTerminatedString(const Constant *C) {
Chris Lattner139822f2012-01-24 14:17:05 +000083 // First check: is we have constant array terminated with zero
Chris Lattner139822f2012-01-24 14:17:05 +000084 if (const ConstantDataSequential *CDS = dyn_cast<ConstantDataSequential>(C)) {
85 unsigned NumElts = CDS->getNumElements();
86 assert(NumElts != 0 && "Can't have an empty CDS");
87
88 if (CDS->getElementAsInteger(NumElts-1) != 0)
89 return false; // Not null terminated.
90
91 // Verify that the null doesn't occur anywhere else in the string.
92 for (unsigned i = 0; i != NumElts-1; ++i)
93 if (CDS->getElementAsInteger(i) == 0)
94 return false;
95 return true;
96 }
Chris Lattner5e693ed2009-07-28 03:13:23 +000097
98 // Another possibility: [1 x i8] zeroinitializer
99 if (isa<ConstantAggregateZero>(C))
Chris Lattner139822f2012-01-24 14:17:05 +0000100 return cast<ArrayType>(C->getType())->getNumElements() == 1;
Chris Lattner5e693ed2009-07-28 03:13:23 +0000101
102 return false;
103}
104
Rafael Espindolaf4e6b292013-12-02 16:25:47 +0000105MCSymbol *TargetLoweringObjectFile::getSymbolWithGlobalValueBase(
Eric Christopher4367c7f2016-09-16 07:33:15 +0000106 const GlobalValue *GV, StringRef Suffix, const TargetMachine &TM) const {
Rafael Espindola117b20c2013-12-05 05:53:12 +0000107 assert(!Suffix.empty());
Rafael Espindola117b20c2013-12-05 05:53:12 +0000108
Rafael Espindolaf4e6b292013-12-02 16:25:47 +0000109 SmallString<60> NameStr;
Mehdi Amini5c0fa582015-07-16 06:04:17 +0000110 NameStr += GV->getParent()->getDataLayout().getPrivateGlobalPrefix();
Eric Christopher4367c7f2016-09-16 07:33:15 +0000111 TM.getNameWithPrefix(NameStr, GV, *Mang);
Rafael Espindolaf4e6b292013-12-02 16:25:47 +0000112 NameStr.append(Suffix.begin(), Suffix.end());
Jim Grosbach6f482002015-05-18 18:43:14 +0000113 return Ctx->getOrCreateSymbol(NameStr);
Rafael Espindolaf4e6b292013-12-02 16:25:47 +0000114}
Rafael Espindolae133ed82013-10-29 17:28:26 +0000115
Rafael Espindoladaeafb42014-02-19 17:23:20 +0000116MCSymbol *TargetLoweringObjectFile::getCFIPersonalitySymbol(
Eric Christopher4367c7f2016-09-16 07:33:15 +0000117 const GlobalValue *GV, const TargetMachine &TM,
Rafael Espindoladaeafb42014-02-19 17:23:20 +0000118 MachineModuleInfo *MMI) const {
Eric Christopher4367c7f2016-09-16 07:33:15 +0000119 return TM.getSymbol(GV, *Mang);
Rafael Espindolaa83b1772011-04-16 03:51:21 +0000120}
121
122void TargetLoweringObjectFile::emitPersonalityValue(MCStreamer &Streamer,
Mehdi Amini5c0fa582015-07-16 06:04:17 +0000123 const DataLayout &,
Rafael Espindolaa83b1772011-04-16 03:51:21 +0000124 const MCSymbol *Sym) const {
Rafael Espindolaa83b1772011-04-16 03:51:21 +0000125}
126
127
Chris Lattnercbc7b262009-08-05 04:25:40 +0000128/// getKindForGlobal - This is a top-level target-independent classifier for
Chris Lattnerc9c277b2009-08-01 21:11:14 +0000129/// a global variable. Given an global variable and information from TM, it
130/// classifies the global in a variety of ways that make various target
131/// implementations simpler. The target implementation is free to ignore this
132/// extra info of course.
Chris Lattnercbc7b262009-08-05 04:25:40 +0000133SectionKind TargetLoweringObjectFile::getKindForGlobal(const GlobalValue *GV,
134 const TargetMachine &TM){
135 assert(!GV->isDeclaration() && !GV->hasAvailableExternallyLinkage() &&
136 "Can only be used for global definitions");
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000137
Chris Lattner5e693ed2009-07-28 03:13:23 +0000138 Reloc::Model ReloModel = TM.getRelocationModel();
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000139
Chris Lattner5e693ed2009-07-28 03:13:23 +0000140 // Early exit - functions should be always in text sections.
141 const GlobalVariable *GVar = dyn_cast<GlobalVariable>(GV);
Craig Topper062a2ba2014-04-25 05:30:21 +0000142 if (!GVar)
Chris Lattnerf8d97102009-08-01 23:57:16 +0000143 return SectionKind::getText();
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000144
Chris Lattner5e693ed2009-07-28 03:13:23 +0000145 // Handle thread-local data first.
146 if (GVar->isThreadLocal()) {
Nick Lewycky50f02cb2011-12-02 22:16:29 +0000147 if (isSuitableForBSS(GVar, TM.Options.NoZerosInBSS))
Chris Lattnerf8d97102009-08-01 23:57:16 +0000148 return SectionKind::getThreadBSS();
149 return SectionKind::getThreadData();
Chris Lattner5e693ed2009-07-28 03:13:23 +0000150 }
151
Chris Lattner5b585f82010-01-19 02:48:26 +0000152 // Variables with common linkage always get classified as common.
153 if (GVar->hasCommonLinkage())
154 return SectionKind::getCommon();
155
Chris Lattner5e693ed2009-07-28 03:13:23 +0000156 // Variable can be easily put to BSS section.
Nick Lewycky50f02cb2011-12-02 22:16:29 +0000157 if (isSuitableForBSS(GVar, TM.Options.NoZerosInBSS)) {
Chris Lattnerb2534212010-01-19 04:15:51 +0000158 if (GVar->hasLocalLinkage())
159 return SectionKind::getBSSLocal();
160 else if (GVar->hasExternalLinkage())
161 return SectionKind::getBSSExtern();
Chris Lattnerf8d97102009-08-01 23:57:16 +0000162 return SectionKind::getBSS();
Chris Lattnerb2534212010-01-19 04:15:51 +0000163 }
Chris Lattner5e693ed2009-07-28 03:13:23 +0000164
Jay Foad60020682011-06-19 18:37:11 +0000165 const Constant *C = GVar->getInitializer();
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000166
Chris Lattner5e693ed2009-07-28 03:13:23 +0000167 // If the global is marked constant, we can put it into a mergable section,
168 // a mergable string section, or general .data if it contains relocations.
Chris Lattnerea4e9832011-01-18 01:23:44 +0000169 if (GVar->isConstant()) {
Chris Lattner5e693ed2009-07-28 03:13:23 +0000170 // If the initializer for the global contains something that requires a
Eric Christopherde9e92e2012-05-05 01:16:06 +0000171 // relocation, then we may have to drop this into a writable data section
Chris Lattner5e693ed2009-07-28 03:13:23 +0000172 // even though it is marked const.
Rafael Espindola65e49022015-11-17 00:51:23 +0000173 if (!C->needsRelocation()) {
Chris Lattnerea4e9832011-01-18 01:23:44 +0000174 // If the global is required to have a unique address, it can't be put
175 // into a mergable section: just drop it into the general read-only
176 // section instead.
Peter Collingbourne96efdd62016-06-14 21:01:22 +0000177 if (!GVar->hasGlobalUnnamedAddr())
Chris Lattnerea4e9832011-01-18 01:23:44 +0000178 return SectionKind::getReadOnly();
Rafael Espindola65e49022015-11-17 00:51:23 +0000179
Chris Lattner5e693ed2009-07-28 03:13:23 +0000180 // If initializer is a null-terminated string, put it in a "cstring"
Chris Lattner81bbf442009-08-04 16:13:09 +0000181 // section of the right width.
Chris Lattner229907c2011-07-18 04:54:35 +0000182 if (ArrayType *ATy = dyn_cast<ArrayType>(C->getType())) {
183 if (IntegerType *ITy =
Chris Lattner81bbf442009-08-04 16:13:09 +0000184 dyn_cast<IntegerType>(ATy->getElementType())) {
185 if ((ITy->getBitWidth() == 8 || ITy->getBitWidth() == 16 ||
186 ITy->getBitWidth() == 32) &&
187 IsNullTerminatedString(C)) {
188 if (ITy->getBitWidth() == 8)
189 return SectionKind::getMergeable1ByteCString();
190 if (ITy->getBitWidth() == 16)
191 return SectionKind::getMergeable2ByteCString();
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000192
Chris Lattner81bbf442009-08-04 16:13:09 +0000193 assert(ITy->getBitWidth() == 32 && "Unknown width");
194 return SectionKind::getMergeable4ByteCString();
195 }
196 }
197 }
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000198
Chris Lattner5e693ed2009-07-28 03:13:23 +0000199 // Otherwise, just drop it into a mergable constant section. If we have
200 // a section for this size, use it, otherwise use the arbitrary sized
201 // mergable section.
Mehdi Amini5c0fa582015-07-16 06:04:17 +0000202 switch (GV->getParent()->getDataLayout().getTypeAllocSize(C->getType())) {
Chris Lattnerf8d97102009-08-01 23:57:16 +0000203 case 4: return SectionKind::getMergeableConst4();
204 case 8: return SectionKind::getMergeableConst8();
205 case 16: return SectionKind::getMergeableConst16();
David Majnemer964b70d2016-02-22 22:23:11 +0000206 case 32: return SectionKind::getMergeableConst32();
Rafael Espindola33804ca2015-01-29 14:12:41 +0000207 default:
208 return SectionKind::getReadOnly();
Chris Lattner5e693ed2009-07-28 03:13:23 +0000209 }
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000210
Rafael Espindola65e49022015-11-17 00:51:23 +0000211 } else {
Oliver Stannard8331aae2016-08-08 15:28:31 +0000212 // In static, ROPI and RWPI relocation models, the linker will resolve
213 // all addresses, so the relocation entries will actually be constants by
214 // the time the app starts up. However, we can't put this into a
215 // mergable section, because the linker doesn't take relocations into
216 // consideration when it tries to merge entries in the section.
217 if (ReloModel == Reloc::Static || ReloModel == Reloc::ROPI ||
218 ReloModel == Reloc::RWPI || ReloModel == Reloc::ROPI_RWPI)
Chris Lattnerf8d97102009-08-01 23:57:16 +0000219 return SectionKind::getReadOnly();
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000220
Chris Lattner5e693ed2009-07-28 03:13:23 +0000221 // Otherwise, the dynamic linker needs to fix it up, put it in the
222 // writable data.rel section.
Chris Lattnerf8d97102009-08-01 23:57:16 +0000223 return SectionKind::getReadOnlyWithRel();
Chris Lattner5e693ed2009-07-28 03:13:23 +0000224 }
225 }
226
Rafael Espindolaa686f122016-06-24 22:19:54 +0000227 // Okay, this isn't a constant.
Rafael Espindola449711c2015-11-18 06:02:15 +0000228 return SectionKind::getData();
Chris Lattner5e693ed2009-07-28 03:13:23 +0000229}
230
Rafael Espindola0709a7b2015-05-21 19:20:38 +0000231/// This method computes the appropriate section to emit the specified global
232/// variable or function definition. This should not be passed external (or
233/// available externally) globals.
Eric Christopher4367c7f2016-09-16 07:33:15 +0000234MCSection *TargetLoweringObjectFile::SectionForGlobal(
235 const GlobalValue *GV, SectionKind Kind, const TargetMachine &TM) const {
Chris Lattner5e693ed2009-07-28 03:13:23 +0000236 // Select section name.
Chris Lattner1ff90132009-08-06 16:39:58 +0000237 if (GV->hasSection())
Eric Christopher4367c7f2016-09-16 07:33:15 +0000238 return getExplicitSectionGlobal(GV, Kind, TM);
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000239
Chris Lattner5e693ed2009-07-28 03:13:23 +0000240 // Use default section depending on the 'type' of global
Eric Christopher4367c7f2016-09-16 07:33:15 +0000241 return SelectSectionForGlobal(GV, Kind, TM);
Chris Lattner5e693ed2009-07-28 03:13:23 +0000242}
243
Rafael Espindola0709a7b2015-05-21 19:20:38 +0000244MCSection *TargetLoweringObjectFile::getSectionForJumpTable(
Eric Christopher4367c7f2016-09-16 07:33:15 +0000245 const Function &F, const TargetMachine &TM) const {
David Majnemera3ea4072016-02-21 01:30:30 +0000246 unsigned Align = 0;
Mehdi Amini5c0fa582015-07-16 06:04:17 +0000247 return getSectionForConstant(F.getParent()->getDataLayout(),
David Majnemera3ea4072016-02-21 01:30:30 +0000248 SectionKind::getReadOnly(), /*C=*/nullptr,
249 Align);
Rafael Espindola29786d42015-02-12 17:16:46 +0000250}
251
Rafael Espindoladf195192015-02-17 23:34:51 +0000252bool TargetLoweringObjectFile::shouldPutJumpTableInFunctionSection(
253 bool UsesLabelDifference, const Function &F) const {
254 // In PIC mode, we need to emit the jump table to the same section as the
255 // function body itself, otherwise the label differences won't make sense.
256 // FIXME: Need a better predicate for this: what about custom entries?
257 if (UsesLabelDifference)
258 return true;
259
260 // We should also do if the section name is NULL or function is declared
261 // in discardable section
262 // FIXME: this isn't the right predicate, should be based on the MCSection
263 // for the function.
264 if (F.isWeakForLinker())
265 return true;
266
267 return false;
268}
269
Rafael Espindola0709a7b2015-05-21 19:20:38 +0000270/// Given a mergable constant with the specified size and relocation
271/// information, return a section that it should be placed in.
Mehdi Amini5c0fa582015-07-16 06:04:17 +0000272MCSection *TargetLoweringObjectFile::getSectionForConstant(
David Majnemera3ea4072016-02-21 01:30:30 +0000273 const DataLayout &DL, SectionKind Kind, const Constant *C,
274 unsigned &Align) const {
Craig Topper062a2ba2014-04-25 05:30:21 +0000275 if (Kind.isReadOnly() && ReadOnlySection != nullptr)
Chris Lattner5e693ed2009-07-28 03:13:23 +0000276 return ReadOnlySection;
Anton Korobeynikov1df58862009-09-09 08:41:20 +0000277
Chris Lattner5e693ed2009-07-28 03:13:23 +0000278 return DataSection;
279}
280
Anton Korobeynikove42af362012-11-14 01:47:00 +0000281/// getTTypeGlobalReference - Return an MCExpr to use for a
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +0000282/// reference to the specified global variable from exception
283/// handling information.
Rafael Espindola15b26692014-02-09 14:50:44 +0000284const MCExpr *TargetLoweringObjectFile::getTTypeGlobalReference(
Eric Christopher4367c7f2016-09-16 07:33:15 +0000285 const GlobalValue *GV, unsigned Encoding, const TargetMachine &TM,
286 MachineModuleInfo *MMI, MCStreamer &Streamer) const {
Anton Korobeynikove42af362012-11-14 01:47:00 +0000287 const MCSymbolRefExpr *Ref =
Eric Christopher4367c7f2016-09-16 07:33:15 +0000288 MCSymbolRefExpr::create(TM.getSymbol(GV, *Mang), getContext());
Anton Korobeynikove42af362012-11-14 01:47:00 +0000289
290 return getTTypeReference(Ref, Encoding, Streamer);
Chris Lattnerb8666022009-09-16 01:46:41 +0000291}
Chris Lattner5e693ed2009-07-28 03:13:23 +0000292
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +0000293const MCExpr *TargetLoweringObjectFile::
Anton Korobeynikove42af362012-11-14 01:47:00 +0000294getTTypeReference(const MCSymbolRefExpr *Sym, unsigned Encoding,
295 MCStreamer &Streamer) const {
Rafael Espindolaa01cdb02011-04-15 15:11:06 +0000296 switch (Encoding & 0x70) {
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +0000297 default:
Chris Lattner2104b8d2010-04-07 22:58:41 +0000298 report_fatal_error("We do not support this DWARF encoding yet!");
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +0000299 case dwarf::DW_EH_PE_absptr:
300 // Do nothing special
Anton Korobeynikove42af362012-11-14 01:47:00 +0000301 return Sym;
Chris Lattner03627cb2010-03-11 21:55:20 +0000302 case dwarf::DW_EH_PE_pcrel: {
303 // Emit a label to the streamer for the current position. This gives us
304 // .-foo addressing.
Jim Grosbach6f482002015-05-18 18:43:14 +0000305 MCSymbol *PCSym = getContext().createTempSymbol();
Chris Lattner03627cb2010-03-11 21:55:20 +0000306 Streamer.EmitLabel(PCSym);
Jim Grosbach13760bd2015-05-30 01:25:56 +0000307 const MCExpr *PC = MCSymbolRefExpr::create(PCSym, getContext());
308 return MCBinaryExpr::createSub(Sym, PC, getContext());
Chris Lattner03627cb2010-03-11 21:55:20 +0000309 }
310 }
Anton Korobeynikovae4ccc12010-02-15 22:35:59 +0000311}
David Blaikief2694972013-06-28 20:05:11 +0000312
Ulrich Weigand2b6fc8d2013-07-02 18:47:09 +0000313const MCExpr *TargetLoweringObjectFile::getDebugThreadLocalSymbol(const MCSymbol *Sym) const {
David Blaikief2694972013-06-28 20:05:11 +0000314 // FIXME: It's not clear what, if any, default this should have - perhaps a
315 // null return could mean 'no location' & we should just do that here.
Jim Grosbach13760bd2015-05-30 01:25:56 +0000316 return MCSymbolRefExpr::create(Sym, *Ctx);
David Blaikief2694972013-06-28 20:05:11 +0000317}
David Majnemer7db449a2015-03-17 23:54:51 +0000318
319void TargetLoweringObjectFile::getNameWithPrefix(
Eric Christopher4367c7f2016-09-16 07:33:15 +0000320 SmallVectorImpl<char> &OutName, const GlobalValue *GV,
Peter Collingbourne94d77862015-11-03 23:40:03 +0000321 const TargetMachine &TM) const {
Eric Christopher4367c7f2016-09-16 07:33:15 +0000322 Mang->getNameWithPrefix(OutName, GV, /*CannotUsePrivateLabel=*/false);
David Majnemer7db449a2015-03-17 23:54:51 +0000323}