File tree Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Expand file tree Collapse file tree 1 file changed +16
-11
lines changed Original file line number Diff line number Diff line change 1414#include " llvm/IR/Instructions.h"
1515#include " llvm/Support/Debug.h"
1616#include " llvm/Support/ErrorHandling.h"
17+ #include " llvm/Support/WithColor.h"
18+ #include " llvm/Support/raw_ostream.h"
1719
1820using namespace llvm ;
1921
@@ -199,20 +201,23 @@ void DiffConsumer::logd(const DiffLogBuilder &Log) {
199201 switch (Log.getLineKind (I)) {
200202 case DC_match:
201203 out << " " ;
202- Log.getLeft (I)->print (dbgs ()); dbgs () << ' \n ' ;
203- // printValue(Log.getLeft(I), true) ;
204+ Log.getLeft (I)->print (dbgs ());
205+ dbgs () << ' \n ' ;
204206 break ;
205- case DC_left:
206- out << " < " ;
207- Log.getLeft (I)->print (dbgs ()); dbgs () << ' \n ' ;
208- // printValue(Log.getLeft(I), true);
207+ case DC_left: {
208+ auto LeftColor = llvm::WithColor (out, raw_ostream::RED);
209+ LeftColor << " < " ;
210+ Log.getLeft (I)->print (LeftColor);
211+ LeftColor << ' \n ' ;
209212 break ;
210- case DC_right:
211- out << " > " ;
212- Log.getRight (I)->print (dbgs ()); dbgs () << ' \n ' ;
213- // printValue(Log.getRight(I), false);
213+ }
214+ case DC_right: {
215+ auto RightColor = llvm::WithColor (out, raw_ostream::GREEN);
216+ RightColor << " > " ;
217+ Log.getRight (I)->print (RightColor);
218+ RightColor << ' \n ' ;
214219 break ;
215220 }
216- // out << "\n";
221+ }
217222 }
218223}
You can’t perform that action at this time.
0 commit comments