[clang] [llvm] [PATCH] [COFF] Implement pragma clang section on COFF targets (PR #112714)
David Spickett via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 1 02:26:36 PDT 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();
----------------
DavidSpickett wrote:
You could consider making this a static function to be used by both places. Especially if there is something like this already for the other formats.
https://github.com/llvm/llvm-project/pull/112714
More information about the cfe-commits
mailing list