[PATCH] D92073: [CodeGen] Add text section prefix for COFF object file

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 25 11:25:20 PST 2020


rnk added inline comments.


================
Comment at: llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp:623
   if (const auto *F = dyn_cast<Function>(GO)) {
     if (Optional<StringRef> Prefix = F->getSectionPrefix()) {
+      raw_svector_ostream(Name) << '.' << *Prefix;
----------------
This is out of scope for the patch, but why is it called a "section prefix" if it goes after the section name? ".text.hot._ZfooEv"


================
Comment at: llvm/test/CodeGen/X86/text-section-prefix.ll:1
+; RUN: llc -function-sections < %s
+
----------------
pengfei wrote:
> What's your checking here?
Please run this test in a few configurations. You can add two RUN lines like:
```
; RUN: llc -mtriple x86_64-linux-gnu %s -o - | FileCheck %s --check-prefix=ELF
; RUN: llc -mtriple x86_64-linux-gnu -unique-section-names=0 %s -o - | FileCheck %s --check-prefix=ELF-NOUNIQ
; RUN: llc -mtriple x86_64-windows-msvc %s -o - | FileCheck %s --check-prefix=MSVC
; RUN: llc -mtriple x86_64-windows-msvc %s -o - | FileCheck %s --check-prefix=MINGW
```

Add check lines for the section directives.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D92073/new/

https://reviews.llvm.org/D92073



More information about the llvm-commits mailing list