Open SchrodingerZhu opened 1 year ago
@QuarticCat @anqurvanillapy
I am struggling to decide if analyzer can be designed in a less ad-hoc way.
I guess our elaborator could expose some hooks for analysis passes so some extra checks could be done via only looking at the self.gamma
🤔️? Or even we just extend the gamma values with some extra flags?
Anyway you code looks legit here but yes I’m still not sure about some possible generalization, maybe we could generalize it in the future when more checks are necessary and clear, accepting this first.
I am struggling to decide if analyzer can be designed in a less ad-hoc way.
I think you are saying: do we need another layer of IR?
I think you are saying: do we need another layer of IR?
A new IR form is not needed I guess, but the extensibility of the analyzer/sanity checking/linter using the existing IR (here it's Expr
) can be considered for a while 👀.
@QuarticCat as you may have already seen, the backend emits code solely based on the core concrete syntax tree (CST) without using 3AC or CFG. To my understanding, since our CST is simpler than CFG in term of graph analysis complexity, there is no need to have the Iterative Dataflow Analysis framework. Correct me if you think otherwise.
Let's have sth like: