[llvm] r331517 - [llvm-mca] use colors for warnings and notes generated by InstrBuilder.
Andrea Di Biagio via llvm-commits
llvm-commits at lists.llvm.org
Fri May 4 06:52:12 PDT 2018
Author: adibiagio
Date: Fri May 4 06:52:12 2018
New Revision: 331517
URL: http://llvm.org/viewvc/llvm-project?rev=331517&view=rev
Log:
[llvm-mca] use colors for warnings and notes generated by InstrBuilder.
Modified:
llvm/trunk/tools/llvm-mca/InstrBuilder.cpp
llvm/trunk/tools/llvm-mca/llvm-mca.cpp
Modified: llvm/trunk/tools/llvm-mca/InstrBuilder.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/InstrBuilder.cpp?rev=331517&r1=331516&r2=331517&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/InstrBuilder.cpp (original)
+++ llvm/trunk/tools/llvm-mca/InstrBuilder.cpp Fri May 4 06:52:12 2018
@@ -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::createIns
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::createIns
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();
Modified: llvm/trunk/tools/llvm-mca/llvm-mca.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-mca/llvm-mca.cpp?rev=331517&r1=331516&r2=331517&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-mca/llvm-mca.cpp (original)
+++ llvm/trunk/tools/llvm-mca/llvm-mca.cpp Fri May 4 06:52:12 2018
@@ -229,8 +229,7 @@ int AssembleInput(const char *ProgName,
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;
}
More information about the llvm-commits
mailing list