Index: llvm/include/llvm/Support/FormattedStream.h =================================================================== --- llvm/include/llvm/Support/FormattedStream.h +++ llvm/include/llvm/Support/FormattedStream.h @@ -145,11 +145,6 @@ return *this; } - raw_ostream &changeColor(enum Colors Color, bool Bold, bool BG) override { - TheStream->changeColor(Color, Bold, BG); - return *this; - } - bool is_displayed() const override { return TheStream->is_displayed(); } Index: llvm/test/tools/llvm-objdump/MachO/arm64-disassembly-color.s =================================================================== --- /dev/null +++ llvm/test/tools/llvm-objdump/MachO/arm64-disassembly-color.s @@ -0,0 +1,25 @@ +// RUN: llvm-mc -triple arm64-apple-macosx %s -filetype=obj -o %t +// RUN: llvm-objdump --color --disassemble %t | FileCheck %s --check-prefix=COLOR +// RUN: llvm-objdump --no-color --disassemble %t | FileCheck %s --check-prefix=NOCOLOR + +sub sp, sp, #16 +str w0, [sp, #12] +ldr w8, [sp, #12] +ldr w9, [sp, #12] +mul w0, w8, w9 +add sp, sp, #16 + + +// COLOR: sub sp, sp, #0x10 +// COLOR: str w0, [sp, #0xc] +// COLOR: ldr w8, [sp, #0xc] +// COLOR: ldr w9, [sp, #0xc] +// COLOR: mul w0, w8, w9 +// COLOR: add sp, sp, #0x10 + +// NOCOLOR: sub sp, sp, #0x10 +// NOCOLOR: str w0, [sp, #0xc] +// NOCOLOR: ldr w8, [sp, #0xc] +// NOCOLOR: ldr w9, [sp, #0xc] +// NOCOLOR: mul w0, w8, w9 +// NOCOLOR: add sp, sp, #0x10 Index: llvm/tools/llvm-objdump/llvm-objdump.cpp =================================================================== --- llvm/tools/llvm-objdump/llvm-objdump.cpp +++ llvm/tools/llvm-objdump/llvm-objdump.cpp @@ -901,6 +901,7 @@ if (!InstPrinter) reportError(Obj.getFileName(), "no instruction printer for target " + TripleName); + InstPrinter->setUseColor(!NoColor); InstPrinter->setPrintImmHex(PrintImmHex); InstPrinter->setPrintBranchImmAsAddress(true); InstPrinter->setSymbolizeOperands(SymbolizeOperands);