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 /clang/lib/CodeGen/CodeGenModule.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 'clang/lib/CodeGen/CodeGenModule.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index b15031dca468..73a9cb9d6e04 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -2635,7 +2635,7 @@ void CodeGenModule::setNonAliasAttributes(GlobalDecl GD, addUsedGlobal(F); if (auto *SA = D->getAttr<PragmaClangTextSectionAttr>()) if (!D->getAttr<SectionAttr>()) - F->addFnAttr("implicit-section-name", SA->getName()); + F->setSection(SA->getName()); llvm::AttrBuilder Attrs(F->getContext()); if (GetCPUAndFeaturesAttributes(GD, Attrs)) { |
