mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-02 02:14:23 +00:00
[CommandLine] Add missing Callbacks
It appears that the cl::bits options are not used anywhere in-tree. In the recent addition to add Callback's to the options, the Callback was missing from this one. This fixes it by adding the same code from the other classes. It also adds a simple test, of sorts, just to make sure these continue compiling.
This commit is contained in:
parent
ff57153d05
commit
5ce4d154f5
@ -1794,6 +1794,14 @@ public:
|
||||
apply(this, Ms...);
|
||||
done();
|
||||
}
|
||||
|
||||
void setCallback(
|
||||
std::function<void(const typename ParserClass::parser_data_type &)> CB) {
|
||||
Callback = CB;
|
||||
}
|
||||
|
||||
std::function<void(const typename ParserClass::parser_data_type &)> Callback =
|
||||
[](const typename ParserClass::parser_data_type &) {};
|
||||
};
|
||||
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
@ -1784,4 +1784,12 @@ TEST(CommandLineTest, Callback) {
|
||||
|
||||
cl::ResetAllOptionOccurrences();
|
||||
}
|
||||
|
||||
enum Enum { Val1, Val2 };
|
||||
static cl::bits<Enum> ExampleBits(
|
||||
cl::desc("An example cl::bits to ensure it compiles"),
|
||||
cl::values(
|
||||
clEnumValN(Val1, "bits-val1", "The Val1 value"),
|
||||
clEnumValN(Val1, "bits-val2", "The Val2 value")));
|
||||
|
||||
} // anonymous namespace
|
||||
|
Loading…
x
Reference in New Issue
Block a user