diff options
author | Yaxun (Sam) Liu <yaxun.liu@amd.com> | 2025-03-11 09:43:14 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-11 09:43:14 -0400 |
commit | da0f9e75d8588bf0adb54060ee77656edfdc1207 (patch) | |
tree | dacf97c63340e33db63e67977413119139bf01ba /llvm/lib/MC/MCStreamer.cpp | |
parent | e3bef37971ae117f49a503e6a9f4dffd3a9a4d80 (diff) | |
download | llvm-da0f9e75d8588bf0adb54060ee77656edfdc1207.zip llvm-da0f9e75d8588bf0adb54060ee77656edfdc1207.tar.gz llvm-da0f9e75d8588bf0adb54060ee77656edfdc1207.tar.bz2 |
Reland: [MC] output inlined-at debug info (#106230) (#130306)
Reland https://github.com/llvm/llvm-project/pull/106230
The original PR was reverted due to compilation time regression.
This PR fixed that by adding a condition OutStreamer->isVerboseAsm() to
the generation of extra inlined-at debug info, so that it does not
affect normal compilation time.
Currently MC print source location of instructions in comments in
assembly when debug info is available, however, it does not include
inlined-at locations when a function is inlined.
For example, function foo is defined in header file a.h and is called
multiple times in b.cpp. If foo is inlined, current assembly will only
show its instructions with their line numbers in a.h. With inlined-at
locations, the assembly will also show where foo is called in b.cpp.
This patch adds inlined-at locations to the comments by using
DebugLoc::print. It makes the printed source location info consistent
with those printed by machine passes.
Diffstat (limited to 'llvm/lib/MC/MCStreamer.cpp')
-rw-r--r-- | llvm/lib/MC/MCStreamer.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/MCStreamer.cpp b/llvm/lib/MC/MCStreamer.cpp index 99b7651..f040954 100644 --- a/llvm/lib/MC/MCStreamer.cpp +++ b/llvm/lib/MC/MCStreamer.cpp @@ -238,7 +238,7 @@ void MCStreamer::emitCFIMTETaggedFrame() { void MCStreamer::emitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, - StringRef FileName) { + StringRef FileName, StringRef Comment) { getContext().setCurrentDwarfLoc(FileNo, Line, Column, Flags, Isa, Discriminator); } |