summaryrefslogtreecommitdiff
path: root/src/ir.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir.cc')
-rw-r--r--src/ir.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ir.cc b/src/ir.cc
index 65152b7d..2d9c8b3a 100644
--- a/src/ir.cc
+++ b/src/ir.cc
@@ -586,17 +586,19 @@ void MakeTypeBindingReverseMapping(
}
}
+Var::Var() : Var(kInvalidIndex, Location()) {}
+
Var::Var(Index index, const Location& loc)
: loc(loc), type_(VarType::Index), index_(index) {}
Var::Var(std::string_view name, const Location& loc)
: loc(loc), type_(VarType::Name), name_(name) {}
-Var::Var(Var&& rhs) : Var(kInvalidIndex) {
+Var::Var(Var&& rhs) : Var() {
*this = std::move(rhs);
}
-Var::Var(const Var& rhs) : Var(kInvalidIndex) {
+Var::Var(const Var& rhs) : Var() {
*this = rhs;
}