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 14
14
#include " llvm/IR/Instructions.h"
15
15
#include " llvm/Support/Debug.h"
16
16
#include " llvm/Support/ErrorHandling.h"
17
+ #include " llvm/Support/WithColor.h"
18
+ #include " llvm/Support/raw_ostream.h"
17
19
18
20
using namespace llvm ;
19
21
@@ -199,20 +201,23 @@ void DiffConsumer::logd(const DiffLogBuilder &Log) {
199
201
switch (Log.getLineKind (I)) {
200
202
case DC_match:
201
203
out << " " ;
202
- Log.getLeft (I)->print (dbgs ()); dbgs () << ' \n ' ;
203
- // printValue(Log.getLeft(I), true) ;
204
+ Log.getLeft (I)->print (dbgs ());
205
+ dbgs () << ' \n ' ;
204
206
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 ' ;
209
212
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 ' ;
214
219
break ;
215
220
}
216
- // out << "\n";
221
+ }
217
222
}
218
223
}
You can’t perform that action at this time.
0 commit comments