aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorEric Christopher <echristo@gmail.com>2016-09-20 16:05:02 +0000
committerEric Christopher <echristo@gmail.com>2016-09-20 16:05:02 +0000
commita1ccdc34336014793462ecfd7c4e335689873f83 (patch)
tree0e30bc8bcf03e01248bc4f246edd9602b7238a24 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parentef579d21953fb66f921fd31ab549f8c2584e67b6 (diff)
downloadllvm-a1ccdc34336014793462ecfd7c4e335689873f83.zip
llvm-a1ccdc34336014793462ecfd7c4e335689873f83.tar.gz
llvm-a1ccdc34336014793462ecfd7c4e335689873f83.tar.bz2
Remove more guts of TargetMachine::getNameWithPrefix and migrate one check to the TLOF mach-o version.
NFC intended. llvm-svn: 281983
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index b92ffde..218b45c9e 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -812,6 +812,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 =