diff options
Diffstat (limited to 'type_resolution.cc')
-rw-r--r-- | type_resolution.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/type_resolution.cc b/type_resolution.cc index d28db66..c9fe51d 100644 --- a/type_resolution.cc +++ b/type_resolution.cc @@ -45,7 +45,7 @@ struct NamedTypes { seen.Reserve(graph.Limit()); } - enum class Tag { STRUCT, UNION, ENUM, TYPEDEF }; + enum class Tag { STRUCT, UNION, ENUM, TYPEDEF, VARIANT }; using Type = std::pair<Tag, std::string>; struct Info { std::vector<Id> definitions; @@ -160,6 +160,14 @@ struct NamedTypes { } } + void operator()(const Variant& x, Id id) { + const auto& name = x.name; + auto& info = GetInfo(Tag::VARIANT, name); + info.definitions.push_back(id); + ++definitions; + (*this)(x.members); + } + void operator()(const Function& x, Id) { (*this)(x.return_type_id); (*this)(x.parameters); |