diff options
author | Eric Christopher <echristo@gmail.com> | 2018-08-01 01:03:34 +0000 |
---|---|---|
committer | Eric Christopher <echristo@gmail.com> | 2018-08-01 01:03:34 +0000 |
commit | ad36c7456266dfbcec991506a324fff7f0e703c3 (patch) | |
tree | 98a7c719e7ac5c1d1a46f8a17537f30d726b28f2 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
parent | ad5bbcceb704e9ce5e94a010492a12b7400f3703 (diff) | |
download | bcm5719-llvm-ad36c7456266dfbcec991506a324fff7f0e703c3.tar.gz bcm5719-llvm-ad36c7456266dfbcec991506a324fff7f0e703c3.zip |
Tidy up logic around unique section name creation and remove a
mostly unused variable.
llvm-svn: 338468
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index b5dd2d4cca8..58e3e71133c 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -455,7 +455,6 @@ static MCSectionELF *selectELFSectionForGlobal( Group = C->getName(); } - bool UniqueSectionNames = TM.getUniqueSectionNames(); SmallString<128> Name; if (Kind.isMergeableCString()) { // We also need alignment here. @@ -479,16 +478,17 @@ static MCSectionELF *selectELFSectionForGlobal( 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, |