Migrate Declaration to variant (#644)

Note this makes some structural choices that I'm not sure how popular they'll be... Most notably, I could remove `DeclarationKind` because I'm using `std::visit` and `Declaration::Visitor` in reality. I could go to `switch(tag())` instead, but I'm wondering if this approach will be well received for the separation of ownership. Alternatively, I could move `Declaration` around so that it actually implements the things like `TopLevel` -- I did feel weird with the old structure of typecheck.cpp implementing members of declaration.h, though.
This commit is contained in:
Jon Meow authored and GitHub committed 2021-07-15 16:22:56 -07:00
1 parent ada2be2d16
commit acb33932cb
9 files changed
+305 -287

No files matched your search

+2 -2
View File
@@ -14,8 +14,8 @@ namespace Carbon {
struct StructDefinition {
int line_num;
std::string* name;
std::list<Member*>* members;
std::string name;
std::list<Member*> members;
};
} // namespace Carbon