diff options
author | Heejin Ahn <aheejin@gmail.com> | 2022-12-07 10:51:06 -0800 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2022-12-09 10:57:32 -0800 |
commit | ae74e59f701724712869e9c50de124c2fe6790c8 (patch) | |
tree | c97e862a2397e7e16dc5693aab3475b17de12558 /llvm/lib/CodeGen | |
parent | f23f26032d136cce25a3711afb92203dbe6fdeba (diff) | |
download | llvm-ae74e59f701724712869e9c50de124c2fe6790c8.zip llvm-ae74e59f701724712869e9c50de124c2fe6790c8.tar.gz llvm-ae74e59f701724712869e9c50de124c2fe6790c8.tar.bz2 |
[WebAssembly] Print DEBUG_VALUE once for target indices
`DEBUG_VALUE` comments are printed before an instruction, so they are
not printed with `AddComment` method as other comments are, but printed
using `emitRawComment` method. But currently `emitDebugValueComment`
calls `emitRawComment` twice for target-index-based `DBG_VALUE`s: once
in the `switch`-`case`,
https://github.com/llvm/llvm-project/blob/d77ae7f2513504655e555cd326208598093d66e2/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1192-L1193
and again at the end of the method:
https://github.com/llvm/llvm-project/blob/d77ae7f2513504655e555cd326208598093d66e2/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp#L1227-L1228
This makes them printed twice. I think this happened through multiple
commits modifying and refactoring this method.
Reviewed By: dschuff
Differential Revision: https://reviews.llvm.org/D139579
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 770a270..fbbe19f 100644 --- a/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -1189,8 +1189,6 @@ static bool emitDebugValueComment(const MachineInstr *MI, AsmPrinter &AP) { } case MachineOperand::MO_TargetIndex: { OS << "!target-index(" << Op.getIndex() << "," << Op.getOffset() << ")"; - // NOTE: Want this comment at start of line, don't emit with AddComment. - AP.OutStreamer->emitRawComment(OS.str()); break; } case MachineOperand::MO_Register: |