[all-commits] [llvm/llvm-project] 29bff4: [llvm-objdump] Fix coloring with nested WithMarkup

Fangrui Song via All-commits all-commits at lists.llvm.org
Tue Oct 29 20:07:17 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 29bff4aad8eb7f54f99e0496b735aee193063b04
      https://github.com/llvm/llvm-project/commit/29bff4aad8eb7f54f99e0496b735aee193063b04
  Author: Fangrui Song <i at maskray.me>
  Date:   2024-10-29 (Tue, 29 Oct 2024)

  Changed paths:
    M llvm/include/llvm/MC/MCInstPrinter.h
    M llvm/lib/MC/MCInstPrinter.cpp
    A llvm/test/tools/llvm-objdump/X86/disassemble-color.s

  Log Message:
  -----------
  [llvm-objdump] Fix coloring with nested WithMarkup

WithMarkup objects may nest, resulting in the `)` in `leaq
(%rdx,%rax), %rbx` to be green instead of the default color,
mismatching the color of `(`.

```
% llvm-mc -triple=x86_64 -mdis <<< '0x48 0x8d 0x1c 0x02'
        .text
        leaq    <mem:(<reg:%rdx>,<reg:%rax>)>, <reg:%rbx>
```

To ensure that `(` and `)` get the same color, maintain a color stack
within MCInstPrinter.

Fix #99661

Pull Request: https://github.com/llvm/llvm-project/pull/113834



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list