Get rid of more constructors and make mangled names optional.

This commit is contained in:
2020-09-18 14:09:03 -07:00
parent 56bdbdc6ee
commit 137455b0f4
3 changed files with 13 additions and 8 deletions

View File

@@ -2,6 +2,7 @@
#include <map>
#include <string>
#include <set>
#include <optional>
#include "graph.hpp"
#include "type.hpp"
@@ -15,11 +16,11 @@ class type_env {
struct variable_data {
type_scheme_ptr type;
visibility vis;
std::string mangled_name;
std::optional<std::string> mangled_name;
variable_data()
: variable_data(nullptr, visibility::local, "") {}
variable_data(type_scheme_ptr t, visibility v, std::string n)
: variable_data(nullptr, visibility::local, std::nullopt) {}
variable_data(type_scheme_ptr t, visibility v, std::optional<std::string> n)
: type(std::move(t)), vis(v), mangled_name(std::move(n)) {}
};