[llvm-mca] use colors for warnings and notes generated by InstrBuilder.

llvm-svn: 331517
This commit is contained in:
Andrea Di Biagio 2018-05-04 13:52:12 +00:00
parent 49c8591397
commit 24fb4fcb93
2 changed files with 10 additions and 10 deletions

View File

@ -16,6 +16,7 @@
#include "llvm/MC/MCInst.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/Support/WithColor.h"
#define DEBUG_TYPE "llvm-mca"
@ -383,8 +384,8 @@ const InstrDesc &InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
std::unique_ptr<InstrDesc> ID = llvm::make_unique<InstrDesc>();
if (SCDesc.isVariant()) {
errs() << "warning: don't know how to model variant opcodes.\n"
<< "note: assume 1 micro opcode.\n";
WithColor::warning() << "don't know how to model variant opcodes.\n";
WithColor::note() << "assume 1 micro opcode.\n";
ID->NumMicroOps = 1U;
} else {
ID->NumMicroOps = SCDesc.NumMicroOps;
@ -392,15 +393,15 @@ const InstrDesc &InstrBuilder::createInstrDescImpl(const MCInst &MCI) {
if (MCDesc.isCall()) {
// We don't correctly model calls.
errs() << "warning: found a call in the input assembly sequence.\n"
<< "note: call instructions are not correctly modeled. Assume a "
"latency of 100cy.\n";
WithColor::warning() << "found a call in the input assembly sequence.\n";
WithColor::note() << "call instructions are not correctly modeled. "
<< "Assume a latency of 100cy.\n";
}
if (MCDesc.isReturn()) {
errs() << "warning: found a return instruction in the input assembly "
"sequence.\n"
<< "note: program counter updates are ignored.\n";
WithColor::warning() << "found a return instruction in the input"
<< " assembly sequence.\n";
WithColor::note() << "program counter updates are ignored.\n";
}
ID->MayLoad = MCDesc.mayLoad();

View File

@ -229,8 +229,7 @@ int AssembleInput(const char *ProgName, MCAsmParser &Parser,
TheTarget->createMCAsmParser(STI, Parser, MCII, MCOptions));
if (!TAP) {
errs() << ProgName
<< ": error: this target does not support assembly parsing.\n";
WithColor::error() << "this target does not support assembly parsing.\n";
return 1;
}