@@ -126,8 +126,7 @@ std::unordered_map<std::string, AST::MacroTranscriberFunc>
{"Hash", MacroBuiltin::proc_macro_builtin},
};
-// FIXME: This should return an tl::optional
-BuiltinMacro
+tl::optional<BuiltinMacro>
builtin_macro_from_string (const std::string &identifier)
{
auto macro = MacroBuiltin::builtins.lookup (identifier);
@@ -75,7 +75,7 @@ enum class BuiltinMacro
Hash,
};
-BuiltinMacro
+tl::optional<BuiltinMacro>
builtin_macro_from_string (const std::string &identifier);
/**
@@ -497,7 +497,7 @@ EarlyNameResolver::visit (AST::MacroInvocation &invoc)
{
auto builtin_kind
= builtin_macro_from_string (rules_def->get_rule_name ().as_string ());
- invoc.map_to_builtin (builtin_kind);
+ invoc.map_to_builtin (builtin_kind.value ());
}
auto attributes = rules_def->get_outer_attrs ();