diff options
| author | Arthur Eubanks <aeubanks@google.com> | 2024-04-11 13:29:29 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-11 12:29:29 -0700 |
| commit | 5d6d8dcd292e0a107b11d378932eee9c2f9ccfc7 (patch) | |
| tree | 48a5f61c610b0d015e75b3b649eb383b63cc9f99 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | |
| parent | 41e8a9b1b2010b8111a0488a03b057cb8e33a199 (diff) | |
[clang][llvm] Remove "implicit-section-name" attribute (#87906)
D33412/D33413 introduced this to support a clang pragma to set section
names for a symbol depending on if it would be placed in
bss/data/rodata/text, which may not be known until the backend. However,
for text we know that only functions will go there, so just directly set
the section in clang instead of going through a completely separate
attribute.
Autoupgrade the "implicit-section-name" attribute to directly setting
the section on a Fuction.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp index 15b59421a0f4..2a77a683a901 100644 --- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp +++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp @@ -797,10 +797,6 @@ static MCSection *selectExplicitSectionGlobal( SectionName = Attrs.getAttribute("data-section").getValueAsString(); } } - const Function *F = dyn_cast<Function>(GO); - if (F && F->hasFnAttribute("implicit-section-name")) { - SectionName = F->getFnAttribute("implicit-section-name").getValueAsString(); - } // Infer section flags from the section name if we can. Kind = getELFKindForNamedSection(SectionName, Kind); @@ -934,7 +930,7 @@ MCSection *TargetLoweringObjectFileELF::getUniqueSectionForFunction( unsigned Flags = getELFSectionFlags(Kind); // If the function's section names is pre-determined via pragma or a // section attribute, call selectExplicitSectionGlobal. - if (F.hasSection() || F.hasFnAttribute("implicit-section-name")) + if (F.hasSection()) return selectExplicitSectionGlobal( &F, Kind, TM, getContext(), getMangler(), NextUniqueID, Used.count(&F), /* ForceUnique = */true); @@ -1298,11 +1294,6 @@ MCSection *TargetLoweringObjectFileMachO::getExplicitSectionGlobal( } } - const Function *F = dyn_cast<Function>(GO); - if (F && F->hasFnAttribute("implicit-section-name")) { - SectionName = F->getFnAttribute("implicit-section-name").getValueAsString(); - } - // Parse the section specifier and create it if valid. StringRef Segment, Section; unsigned TAA = 0, StubSize = 0; |
