From a1ccdc34336014793462ecfd7c4e335689873f83 Mon Sep 17 00:00:00 2001 From: Eric Christopher Date: Tue, 20 Sep 2016 16:05:02 +0000 Subject: Remove more guts of TargetMachine::getNameWithPrefix and migrate one check to the TLOF mach-o version. NFC intended. llvm-svn: 281983 --- llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp') diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index b92ffde23198..218b45c9e747 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 &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 = -- cgit v1.2.3