File tree 2 files changed +8
-16
lines changed
2 files changed +8
-16
lines changed Original file line number Diff line number Diff line change @@ -56,9 +56,11 @@ void Stream::writeValue(std::ostream& OS, const llvm::Value& V) {
56
56
namespace Logger
57
57
{
58
58
static std::string indent_str;
59
+ bool _enabled;
59
60
60
- llvm::cl::opt<bool > _enabled (" vv" ,
61
+ static llvm::cl::opt<bool , true > enabledopt (" vv" ,
61
62
llvm::cl::desc (" Print front-end/glue code debug log" ),
63
+ llvm::cl::location(_enabled),
62
64
llvm::cl::ZeroOrMore);
63
65
64
66
void indent ()
@@ -126,18 +128,6 @@ namespace Logger
126
128
va_end (va);
127
129
}
128
130
}
129
- void enable ()
130
- {
131
- _enabled = true ;
132
- }
133
- void disable ()
134
- {
135
- _enabled = false ;
136
- }
137
- bool enabled ()
138
- {
139
- return _enabled;
140
- }
141
131
void attention (Loc loc, const char * fmt,...)
142
132
{
143
133
va_list va;
Original file line number Diff line number Diff line change @@ -95,14 +95,16 @@ class Stream {
95
95
96
96
namespace Logger
97
97
{
98
+ extern bool _enabled;
99
+
98
100
void indent ();
99
101
void undent ();
100
102
Stream cout ();
101
103
void println (const char * fmt, ...) IS_PRINTF(1 );
102
104
void print (const char * fmt, ...) IS_PRINTF(1 );
103
- void enable ();
104
- void disable ();
105
- bool enabled ();
105
+ inline void enable () { _enabled = true ; }
106
+ inline void disable () { _enabled = false ; }
107
+ inline bool enabled () { return _enabled; }
106
108
107
109
void attention (Loc loc, const char * fmt, ...) IS_PRINTF(2 );
108
110
You can’t perform that action at this time.
0 commit comments