Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,14 @@ const char *SDNode::getIndexedModeName(ISD::MemIndexedMode AM) {
static Printable PrintNodeId(const SDNode &Node) {
return Printable([&Node](raw_ostream &OS) {
#ifndef NDEBUG
static const raw_ostream::Colors Color[] = {
raw_ostream::BLACK, raw_ostream::RED, raw_ostream::GREEN,
raw_ostream::YELLOW, raw_ostream::BLUE, raw_ostream::MAGENTA,
raw_ostream::CYAN,
};
OS.changeColor(Color[Node.PersistentId % std::size(Color)]);
OS << 't' << Node.PersistentId;
OS.resetColor();
#else
OS << (const void*)&Node;
#endif
Expand Down
2 changes: 2 additions & 0 deletions llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4415,6 +4415,8 @@ void SelectionDAGISel::CannotYetSelect(SDNode *N) {
raw_string_ostream Msg(msg);
Msg << "Cannot select: ";

Msg.enable_colors(errs().has_colors());

if (N->getOpcode() != ISD::INTRINSIC_W_CHAIN &&
N->getOpcode() != ISD::INTRINSIC_WO_CHAIN &&
N->getOpcode() != ISD::INTRINSIC_VOID) {
Expand Down