Skip to content
This repository was archived by the owner on Feb 5, 2019. It is now read-only.

Commit bf9b77d

Browse files
committed
Tidy up logic around unique section name creation and remove a
mostly unused variable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@338468 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent a390496 commit bf9b77d

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/CodeGen/TargetLoweringObjectFileImpl.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -455,7 +455,6 @@ static MCSectionELF *selectELFSectionForGlobal(
455455
Group = C->getName();
456456
}
457457

458-
bool UniqueSectionNames = TM.getUniqueSectionNames();
459458
SmallString<128> Name;
460459
if (Kind.isMergeableCString()) {
461460
// We also need alignment here.
@@ -479,16 +478,17 @@ static MCSectionELF *selectELFSectionForGlobal(
479478
Name += *OptionalPrefix;
480479
}
481480

482-
if (EmitUniqueSection && UniqueSectionNames) {
483-
Name.push_back('.');
484-
TM.getNameWithPrefix(Name, GO, Mang, true);
485-
}
486481
unsigned UniqueID = MCContext::GenericSectionID;
487-
if (EmitUniqueSection && !UniqueSectionNames) {
488-
UniqueID = *NextUniqueID;
489-
(*NextUniqueID)++;
482+
if (EmitUniqueSection) {
483+
if (TM.getUniqueSectionNames()) {
484+
Name.push_back('.');
485+
TM.getNameWithPrefix(Name, GO, Mang, true /*MayAlwaysUsePrivate*/);
486+
} else {
487+
UniqueID = *NextUniqueID;
488+
(*NextUniqueID)++;
489+
}
490490
}
491-
// Use 0 as the unique ID for execute-only text
491+
// Use 0 as the unique ID for execute-only text.
492492
if (Kind.isExecuteOnly())
493493
UniqueID = 0;
494494
return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags,

0 commit comments

Comments
 (0)