[PATCH] D93876: Do not implicitly turn on function sections with basic block sections.
Rahman Lavaee via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Dec 29 13:51:30 PST 2020
rahmanl added a comment.
Can we add a test with the `=list` option to verify that functions not requiring basic block sections are not emitted in unique sections?
Or maybe we can use the existing `basic-block-sections-list.ll` by adding a new invocation without `-function-sections`.
================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:931
+ const Function &F, const TargetMachine &TM) const {
+ SectionKind Kind = SectionKind::getText();
+ unsigned Flags = getELFSectionFlags(Kind);
----------------
Can we add `const` here?
================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:938
+ MCSectionELF *Section = selectELFSectionForGlobal(
+ getContext(), &F, Kind, getMangler(), TM, true, Flags,
+ &NextUniqueID, LinkedToSym);
----------------
It makes it much more clear if we add an inline comment like `/* EmitUniqueSection */ true` here.
================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:940
+ &NextUniqueID, LinkedToSym);
+ assert(Section->getLinkedToSymbol() == LinkedToSym);
+ return Section;
----------------
Maybe we can add a message to the assert.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D93876/new/
https://reviews.llvm.org/D93876
More information about the llvm-commits
mailing list