summaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2025-07-18 13:26:00 -0700
committerPeter Collingbourne <peter@pcc.me.uk>2025-07-18 13:26:00 -0700
commit9bf3524731070cadc6175707314f3b6ca37190d5 (patch)
tree86dcab7604336b01ae938fe81062c29ff69efba8 /llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
parent3a84c15cc13b6daf8e812592898ab6c7f19091a9 (diff)
parent4f43f0606c3d7e1ce6d069583b5e59f036e112ce (diff)
Created using spr 1.3.6-beta.1
Diffstat (limited to 'llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp')
-rw-r--r--llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp23
1 files changed, 1 insertions, 22 deletions
diff --git a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
index 5454cd475f5e..7e501a9e2aa4 100644
--- a/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
+++ b/llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
@@ -322,28 +322,7 @@ void TargetLoweringObjectFileELF::emitModuleMetadata(MCStreamer &Streamer,
}
}
- if (NamedMDNode *FuncInfo = M.getNamedMetadata(PseudoProbeDescMetadataName)) {
- // Emit a descriptor for every function including functions that have an
- // available external linkage. We may not want this for imported functions
- // that has code in another thinLTO module but we don't have a good way to
- // tell them apart from inline functions defined in header files. Therefore
- // we put each descriptor in a separate comdat section and rely on the
- // linker to deduplicate.
- for (const auto *Operand : FuncInfo->operands()) {
- const auto *MD = cast<MDNode>(Operand);
- auto *GUID = mdconst::dyn_extract<ConstantInt>(MD->getOperand(0));
- auto *Hash = mdconst::dyn_extract<ConstantInt>(MD->getOperand(1));
- auto *Name = cast<MDString>(MD->getOperand(2));
- auto *S = C.getObjectFileInfo()->getPseudoProbeDescSection(
- TM->getFunctionSections() ? Name->getString() : StringRef());
-
- Streamer.switchSection(S);
- Streamer.emitInt64(GUID->getZExtValue());
- Streamer.emitInt64(Hash->getZExtValue());
- Streamer.emitULEB128IntValue(Name->getString().size());
- Streamer.emitBytes(Name->getString());
- }
- }
+ emitPseudoProbeDescMetadata(Streamer, M);
if (NamedMDNode *LLVMStats = M.getNamedMetadata("llvm.stats")) {
// Emit the metadata for llvm statistics into .llvm_stats section, which is