[clang] [llvm] [clang] Implement pragma clang section on COFF targets (PR #112714)

Vinicius Tadeu Zein via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 22 08:08:59 PST 2024


================
@@ -1677,6 +1677,22 @@ MCSection *TargetLoweringObjectFileCOFF::getExplicitSectionGlobal(
       Name == getInstrProfSectionName(IPSK_covname, Triple::COFF,
                                       /*AddSegmentInfo=*/false))
     Kind = SectionKind::getMetadata();
+
+  const GlobalVariable *GV = dyn_cast<GlobalVariable>(GO);
+  if (GV && GV->hasImplicitSection()) {
+    auto Attrs = GV->getAttributes();
+    if (Attrs.hasAttribute("bss-section") && Kind.isBSS()) {
----------------
vtz wrote:

Done

https://github.com/llvm/llvm-project/pull/112714


More information about the llvm-commits mailing list