|
9 | 9 | #ifndef LLVM_SUPPORT_WITHCOLOR_H
|
10 | 10 | #define LLVM_SUPPORT_WITHCOLOR_H
|
11 | 11 |
|
| 12 | +#include "llvm/Support/Compiler.h" |
12 | 13 | #include "llvm/Support/raw_ostream.h"
|
13 | 14 |
|
14 | 15 | namespace llvm {
|
@@ -58,19 +59,18 @@ class WithColor {
|
58 | 59 | /// @param OS The output stream
|
59 | 60 | /// @param S Symbolic name for syntax element to color
|
60 | 61 | /// @param Mode Enable, disable or compute whether to use colors.
|
61 |
| - WithColor(raw_ostream &OS, HighlightColor S, |
62 |
| - ColorMode Mode = ColorMode::Auto); |
| 62 | + LLVM_CTOR_NODISCARD WithColor(raw_ostream &OS, HighlightColor S, |
| 63 | + ColorMode Mode = ColorMode::Auto); |
63 | 64 | /// To be used like this: WithColor(OS, raw_ostream::BLACK) << "text";
|
64 | 65 | /// @param OS The output stream
|
65 | 66 | /// @param Color ANSI color to use, the special SAVEDCOLOR can be used to
|
66 | 67 | /// change only the bold attribute, and keep colors untouched
|
67 | 68 | /// @param Bold Bold/brighter text, default false
|
68 | 69 | /// @param BG If true, change the background, default: change foreground
|
69 | 70 | /// @param Mode Enable, disable or compute whether to use colors.
|
70 |
| - WithColor(raw_ostream &OS, |
71 |
| - raw_ostream::Colors Color = raw_ostream::SAVEDCOLOR, |
72 |
| - bool Bold = false, bool BG = false, |
73 |
| - ColorMode Mode = ColorMode::Auto) |
| 71 | + LLVM_CTOR_NODISCARD WithColor( |
| 72 | + raw_ostream &OS, raw_ostream::Colors Color = raw_ostream::SAVEDCOLOR, |
| 73 | + bool Bold = false, bool BG = false, ColorMode Mode = ColorMode::Auto) |
74 | 74 | : OS(OS), Mode(Mode) {
|
75 | 75 | changeColor(Color, Bold, BG);
|
76 | 76 | }
|
|
0 commit comments