[llvm] r338468 - Tidy up logic around unique section name creation and remove a
Eric Christopher via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 31 18:03:34 PDT 2018
Author: echristo
Date: Tue Jul 31 18:03:34 2018
New Revision: 338468
URL: http://llvm.org/viewvc/llvm-project?rev=338468&view=rev
Log:
Tidy up logic around unique section name creation and remove a
mostly unused variable.
Modified:
llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
Modified: llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp?rev=338468&r1=338467&r2=338468&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp (original)
+++ llvm/trunk/lib/CodeGen/TargetLoweringObjectFileImpl.cpp Tue Jul 31 18:03:34 2018
@@ -455,7 +455,6 @@ static MCSectionELF *selectELFSectionFor
Group = C->getName();
}
- bool UniqueSectionNames = TM.getUniqueSectionNames();
SmallString<128> Name;
if (Kind.isMergeableCString()) {
// We also need alignment here.
@@ -479,16 +478,17 @@ static MCSectionELF *selectELFSectionFor
Name += *OptionalPrefix;
}
- if (EmitUniqueSection && UniqueSectionNames) {
- Name.push_back('.');
- TM.getNameWithPrefix(Name, GO, Mang, true);
- }
unsigned UniqueID = MCContext::GenericSectionID;
- if (EmitUniqueSection && !UniqueSectionNames) {
- UniqueID = *NextUniqueID;
- (*NextUniqueID)++;
+ if (EmitUniqueSection) {
+ if (TM.getUniqueSectionNames()) {
+ Name.push_back('.');
+ TM.getNameWithPrefix(Name, GO, Mang, true /*MayAlwaysUsePrivate*/);
+ } else {
+ UniqueID = *NextUniqueID;
+ (*NextUniqueID)++;
+ }
}
- // Use 0 as the unique ID for execute-only text
+ // Use 0 as the unique ID for execute-only text.
if (Kind.isExecuteOnly())
UniqueID = 0;
return Ctx.getELFSection(Name, getELFSectionType(Name, Kind), Flags,
More information about the llvm-commits
mailing list