16 VariantMatcher::Payload::~Payload() =
default;
22 std::optional<DynMatcher>
getDynMatcher()
const override {
return matcher; }
33 return VariantMatcher(std::make_shared<SinglePayload>(std::move(matcher)));
37 return value ? value->getDynMatcher() : std::nullopt;
45 : type(ValueType::Nothing) {
50 : type(ValueType::
String) {
51 value.String =
new llvm::StringRef(
string);
66 case ValueType::String:
69 case ValueType::Matcher:
72 case ValueType::Nothing:
73 type = ValueType::Nothing;
79 void VariantValue::reset() {
81 case ValueType::String:
84 case ValueType::Matcher:
88 case ValueType::Nothing:
91 type = ValueType::Nothing;
103 type = ValueType::String;
104 value.String =
new llvm::StringRef(newValue);
111 return *value.Matcher;
116 type = ValueType::Matcher;
122 case ValueType::String:
124 case ValueType::Matcher:
126 case ValueType::Nothing:
129 llvm_unreachable(
"Invalid Type");
std::string getTypeAsString() const override
SinglePayload(DynMatcher matcher)
std::optional< DynMatcher > getDynMatcher() const override
static VariantMatcher SingleMatcher(DynMatcher matcher)
std::optional< DynMatcher > getDynMatcher() const
std::string getTypeAsString() const
std::string getTypeAsString() const
VariantValue & operator=(const VariantValue &other)
const VariantMatcher & getMatcher() const
void setMatcher(const VariantMatcher &matcher)
const llvm::StringRef & getString() const
void setString(const llvm::StringRef &string)