@@ -83,22 +83,19 @@ class PassOptions : protected llvm::cl::SubCommand {
83
83
84
84
// / Utility methods for printing option values.
85
85
template <typename DataT>
86
- static void printOptionValue (raw_ostream &os,
87
- GenericOptionParser<DataT> &parser,
88
- const DataT &value) {
86
+ static void printValue (raw_ostream &os, GenericOptionParser<DataT> &parser,
87
+ const DataT &value) {
89
88
if (Optional<StringRef> argStr = parser.findArgStrForValue (value))
90
89
os << argStr;
91
90
else
92
91
llvm_unreachable (" unknown data value for option" );
93
92
}
94
93
template <typename DataT, typename ParserT>
95
- static void printOptionValue (raw_ostream &os, ParserT &parser,
96
- const DataT &value) {
94
+ static void printValue (raw_ostream &os, ParserT &parser, const DataT &value) {
97
95
os << value;
98
96
}
99
97
template <typename ParserT>
100
- static void printOptionValue (raw_ostream &os, ParserT &parser,
101
- const bool &value) {
98
+ static void printValue (raw_ostream &os, ParserT &parser, const bool &value) {
102
99
os << (value ? StringRef (" true" ) : StringRef (" false" ));
103
100
}
104
101
@@ -129,7 +126,7 @@ class PassOptions : protected llvm::cl::SubCommand {
129
126
// / Print the name and value of this option to the given stream.
130
127
void print (raw_ostream &os) final {
131
128
os << this ->ArgStr << ' =' ;
132
- printOptionValue (os, this ->getParser (), this ->getValue ());
129
+ printValue (os, this ->getParser (), this ->getValue ());
133
130
}
134
131
135
132
// / Copy the value from the given option into this one.
@@ -172,7 +169,7 @@ class PassOptions : protected llvm::cl::SubCommand {
172
169
void print (raw_ostream &os) final {
173
170
os << this ->ArgStr << ' =' ;
174
171
auto printElementFn = [&](const DataType &value) {
175
- printOptionValue (os, this ->getParser (), value);
172
+ printValue (os, this ->getParser (), value);
176
173
};
177
174
interleave (*this , os, printElementFn, " ," );
178
175
}
@@ -239,3 +236,4 @@ struct EmptyPipelineOptions : public PassPipelineOptions<EmptyPipelineOptions> {
239
236
} // end namespace mlir
240
237
241
238
#endif // MLIR_PASS_PASSOPTIONS_H_
239
+
0 commit comments