summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2016-10-14 05:47:41 +0000
committerEric Christopher <echristo@gmail.com>2016-10-14 05:47:41 +0000
commit2bd52b5d91f7f560f86eb60a7852e5c2f44aefa3 (patch)
tree502348d7869485a76f4dcf7f47a75b72c62547d5 /llvm/lib/CodeGen
parent445c952bd0a3b35244476ba7ef9ff44b5483dfea (diff)
downloadbcm5719-llvm-2bd52b5d91f7f560f86eb60a7852e5c2f44aefa3.tar.gz
bcm5719-llvm-2bd52b5d91f7f560f86eb60a7852e5c2f44aefa3.zip
In preparation for removing getNameWithPrefix off of TargetMachine,
sink the current behavior into the callers and sink TargetMachine::getNameWithPrefix into TargetMachine::getSymbol. llvm-svn: 284203
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index edaa778a605..b8339eefd9c 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -301,7 +301,7 @@ selectELFSectionForGlobal(MCContext &Ctx, const GlobalValue *GV,
if (EmitUniqueSection && UniqueSectionNames) {
Name.push_back('.');
- TM.getNameWithPrefix(Name, GV, Mang, true);
+ Mang.getNameWithPrefix(Name, GV, false);
}
unsigned UniqueID = MCContext::GenericSectionID;
if (EmitUniqueSection && !UniqueSectionNames) {
@@ -817,6 +817,13 @@ static bool canUsePrivateLabel(const MCAsmInfo &AsmInfo,
void TargetLoweringObjectFileMachO::getNameWithPrefix(
SmallVectorImpl<char> &OutName, const GlobalValue *GV,
const TargetMachine &TM) const {
+ if (!GV->hasPrivateLinkage()) {
+ // Simple case: If GV is not private, it is not important to find out if
+ // private labels are legal in this case or not.
+ getMangler().getNameWithPrefix(OutName, GV, false);
+ return;
+ }
+
SectionKind GVKind = TargetLoweringObjectFile::getKindForGlobal(GV, TM);
const MCSection *TheSection = SectionForGlobal(GV, GVKind, TM);
bool CannotUsePrivateLabel =
OpenPOWER on IntegriCloud