Closed melvinw closed 3 months ago
Just double-checked: the diff of _gen/bin/oils_for_unix.mycpp.cc
is empty between this patch and master
OK great, yeah this looks more reasonable
It is more verbose but I think being explicit is better. Thanks!
Hm I imagine if we have our own IR, I guess we would do a transformation where
if CPP
blocks replaced with "if" branchif PYTHON
blocks replaced with "else" branch, if any__name__ ...
blocks deletedi.e. we would create new DATA rather than changing the way we iterate over the MyPy data
But I realize that is hard because everything is so tightly coupled to MyPy right now
Having explicit decoupled functions in util.py
will help us move to that style I think
Now I think the downside of visitors is that everything becomes very tightly coupled to that API , which is the problem we are having ...
The
SimpleVisitor
base class was missing these before. This was causingir_pass
to run into various collisions thatcppgen_pass
wasn't. Fixing this allows us to makeHeapObjectMember
more strict, which simplifies the next datalog patch.