Skip to content

Commit a1daf81

Browse files
committed
[send-non-sendable] Remove ASCII color from log output.
Not everyone uses color output and having to remove the ASCII color support is annoying.
1 parent ce11162 commit a1daf81

File tree

2 files changed

+9
-30
lines changed

2 files changed

+9
-30
lines changed

include/swift/SILOptimizer/Utils/PartitionUtils.h

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -156,34 +156,19 @@ class PartitionOp {
156156
raw_ostream &os = llvm::errs();
157157
switch (OpKind) {
158158
case PartitionOpKind::Assign:
159-
os.changeColor(llvm::raw_ostream::CYAN, true);
160-
os << "assign";
161-
os.resetColor();
162-
os << " %%" << OpArgs[0] << " = %%" << OpArgs[1] << "\n";
159+
os << "assign %%" << OpArgs[0] << " = %%" << OpArgs[1] << "\n";
163160
break;
164161
case PartitionOpKind::AssignFresh:
165-
os.changeColor(llvm::raw_ostream::GREEN, true);
166-
os << "assign_fresh";
167-
os.resetColor();
168-
os << " %%" << OpArgs[0] << "\n";
162+
os << "assign_fresh %%" << OpArgs[0] << "\n";
169163
break;
170164
case PartitionOpKind::Consume:
171-
os.changeColor(llvm::raw_ostream::RED, true);
172-
os << "consume";
173-
os.resetColor();
174-
os << " %%" << OpArgs[0] << "\n";
165+
os << "consume %%" << OpArgs[0] << "\n";
175166
break;
176167
case PartitionOpKind::Merge:
177-
os.changeColor(llvm::raw_ostream::BLUE, true);
178-
os << "merge";
179-
os.resetColor();
180-
os << " %%" << OpArgs[0] << " with %%" << OpArgs[1] << "\n";
168+
os << "merge %%" << OpArgs[0] << " with %%" << OpArgs[1] << "\n";
181169
break;
182170
case PartitionOpKind::Require:
183-
os.changeColor(llvm::raw_ostream::YELLOW, true);
184-
os << "require";
185-
os.resetColor();
186-
os << " %%" << OpArgs[0] << "\n";
171+
os << "require %%" << OpArgs[0] << "\n";
187172
break;
188173
}
189174
}

lib/SILOptimizer/Mandatory/SendNonSendable.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -885,14 +885,10 @@ class PartitionOpTranslator {
885885
//ignored instructions
886886
return {};
887887

888-
LLVM_DEBUG(
889-
llvm::errs().changeColor(llvm::raw_ostream::MAGENTA, true);
890-
llvm::errs() << "warning: ";
891-
llvm::errs().resetColor();
892-
llvm::errs() << "unhandled instruction kind "
893-
<< getSILInstructionName(instruction->getKind())
894-
<< "\n";
895-
);
888+
LLVM_DEBUG(llvm::errs() << "warning: ";
889+
llvm::errs()
890+
<< "unhandled instruction kind "
891+
<< getSILInstructionName(instruction->getKind()) << "\n";);
896892

897893
return {};
898894
}
@@ -1427,9 +1423,7 @@ class RaceTracer {
14271423
working.apply(op);
14281424
llvm::dbgs() << "";
14291425
if (working.isConsumed(consumedVal)) {
1430-
llvm::errs().changeColor(llvm::raw_ostream::RED, true);
14311426
llvm::errs() << "(" << consumedVal << " CONSUMED) ";
1432-
llvm::errs().resetColor();
14331427
}
14341428
working.dump();
14351429
return true;

0 commit comments

Comments
 (0)