aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorHaohai Wen <haohai.wen@intel.com>2025-09-01 08:31:40 +0800
committerGitHub <noreply@github.com>2025-09-01 08:31:40 +0800
commit2e122990391b2ba062e6308a12cfedf7206270ba (patch)
tree8fec465e4d989f1996e620418fcc0723490a97b0 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parenta49030e493b76bc2b294d36709c7ed84aef557f4 (diff)
downloadllvm-2e122990391b2ba062e6308a12cfedf7206270ba.zip
llvm-2e122990391b2ba062e6308a12cfedf7206270ba.tar.gz
llvm-2e122990391b2ba062e6308a12cfedf7206270ba.tar.bz2
[PseudoProbe] Support emitting to COFF object (#123870)
RFC: https://discourse.llvm.org/t/rfc-support-pseudo-probe-for-windows-coff/83820 Support emitting pseudo probe to .pseudo_probe and .pseudo_probe_desc COFF sections.
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 739dcc7f..ae681b9 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -1920,6 +1920,13 @@ void TargetLoweringObjectFileCOFF::emitModuleMetadata(MCStreamer &Streamer,
}
emitCGProfileMetadata(Streamer, M);
+ emitPseudoProbeDescMetadata(Streamer, M, [](MCStreamer &Streamer) {
+ if (MCSymbol *Sym =
+ static_cast<MCSectionCOFF *>(Streamer.getCurrentSectionOnly())
+ ->getCOMDATSymbol())
+ if (Sym->isUndefined())
+ Streamer.emitLabel(Sym);
+ });
}
void TargetLoweringObjectFileCOFF::emitLinkerDirectives(