[PATCH] D99487: [CodeGen] Port basic block sections from ELF to COFF
TaoPan via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 31 18:08:13 PDT 2021
TaoPan added inline comments.
================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:1711
+ COFF::IMAGE_SCN_CNT_CODE | COFF::IMAGE_SCN_MEM_EXECUTE |
+ COFF::IMAGE_SCN_MEM_READ | COFF::IMAGE_SCN_LNK_COMDAT,
+ SectionKind::getText(), COMDATSymName,
----------------
TaoPan wrote:
> tmsriram wrote:
> > Why is this set to always comdat? This should be comdat only if the function is comdat, right?
> Thanks for pointing out comdat or not depending on the specific situation! I'll add comdat test to basic-block-sections.ll for making sure both comdat and not comdat work correctly. Then I'll answer your second question.
I referred to the existing COFF code (TargetLoweringObjectFileCOFF::SelectSectionForGlobal()), COFF::IMAGE_SCN_LNK_COMDAT of text section is set when setting -function-sections and the function is comdat.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D99487/new/
https://reviews.llvm.org/D99487
More information about the llvm-commits
mailing list