Skip to content

[PseudoProbe] use print to emit function name #147873

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 14, 2025
Merged

Conversation

HaohaiWen
Copy link
Contributor

This PR is part of #123870.

For COFF Asm, function name should be wrapped in quotes.
MCSymbol::print will automatically do that.

This PR is part of llvm#123870.

For COFF Asm, function name should be wrapped in quotes.
MCSymbol::print will automatically do that.
@llvmbot llvmbot added the mc Machine (object) code label Jul 10, 2025
@llvmbot
Copy link
Member

llvmbot commented Jul 10, 2025

@llvm/pr-subscribers-mc

Author: Haohai Wen (HaohaiWen)

Changes

This PR is part of #123870.

For COFF Asm, function name should be wrapped in quotes.
MCSymbol::print will automatically do that.


Full diff: https://github.com/llvm/llvm-project/pull/147873.diff

1 Files Affected:

  • (modified) llvm/lib/MC/MCAsmStreamer.cpp (+2-1)
diff --git a/llvm/lib/MC/MCAsmStreamer.cpp b/llvm/lib/MC/MCAsmStreamer.cpp
index aae02652564d3..7eaad409a2eda 100644
--- a/llvm/lib/MC/MCAsmStreamer.cpp
+++ b/llvm/lib/MC/MCAsmStreamer.cpp
@@ -2466,7 +2466,8 @@ void MCAsmStreamer::emitPseudoProbe(uint64_t Guid, uint64_t Index,
   for (const auto &Site : InlineStack)
     OS << " @ " << std::get<0>(Site) << ":" << std::get<1>(Site);
 
-  OS << " " << FnSym->getName();
+  OS << " ";
+  FnSym->print(OS, MAI);
 
   EmitEOL();
 }

@HaohaiWen HaohaiWen requested a review from MaskRay July 11, 2025 00:40
Copy link
Contributor

@williamweixiao williamweixiao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@HaohaiWen HaohaiWen merged commit 6b7c6fd into llvm:main Jul 14, 2025
11 checks passed
@HaohaiWen HaohaiWen deleted the probe branch July 14, 2025 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mc Machine (object) code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants