Skip to content
This repository was archived by the owner on Apr 23, 2021. It is now read-only.

Commit 5b3f922

Browse files
River707tensorflower-gardener
authored andcommitted
NFC: Rename printOptionValue to printValue to fix MSVC build.
MSVC has trouble resolving the static 'printOptionValue' from the method on llvm::cl::opt/list. This change renames the static method to avoid this conflict. PiperOrigin-RevId: 286978351
1 parent 491949a commit 5b3f922

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

include/mlir/Pass/PassOptions.h

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,19 @@ class PassOptions : protected llvm::cl::SubCommand {
8383

8484
/// Utility methods for printing option values.
8585
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) {
8988
if (Optional<StringRef> argStr = parser.findArgStrForValue(value))
9089
os << argStr;
9190
else
9291
llvm_unreachable("unknown data value for option");
9392
}
9493
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) {
9795
os << value;
9896
}
9997
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) {
10299
os << (value ? StringRef("true") : StringRef("false"));
103100
}
104101

@@ -129,7 +126,7 @@ class PassOptions : protected llvm::cl::SubCommand {
129126
/// Print the name and value of this option to the given stream.
130127
void print(raw_ostream &os) final {
131128
os << this->ArgStr << '=';
132-
printOptionValue(os, this->getParser(), this->getValue());
129+
printValue(os, this->getParser(), this->getValue());
133130
}
134131

135132
/// Copy the value from the given option into this one.
@@ -172,7 +169,7 @@ class PassOptions : protected llvm::cl::SubCommand {
172169
void print(raw_ostream &os) final {
173170
os << this->ArgStr << '=';
174171
auto printElementFn = [&](const DataType &value) {
175-
printOptionValue(os, this->getParser(), value);
172+
printValue(os, this->getParser(), value);
176173
};
177174
interleave(*this, os, printElementFn, ",");
178175
}

0 commit comments

Comments
 (0)