diff options
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index b92ffde2319..218b45c9e74 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 = |