[llvm] [llvm-objdump] Fix coloring with nested WithMarkup (PR #113834)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 28 01:19:36 PDT 2024


================
@@ -226,27 +226,32 @@ format_object<uint64_t> MCInstPrinter::formatHex(uint64_t Value) const {
 
 MCInstPrinter::WithMarkup MCInstPrinter::markup(raw_ostream &OS,
                                                 Markup S) const {
-  return WithMarkup(OS, S, getUseMarkup(), getUseColor());
+  return WithMarkup(const_cast<MCInstPrinter &>(*this), OS, S, getUseMarkup(),
----------------
jh7370 wrote:

Overall approach looks fine, but this does feel a bit like an abuse of `const`. Could `const` be dropped from the `markup` method?

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


More information about the llvm-commits mailing list