3 ms·
> Otherwise why does the AST not qualify? I'm sure someone will disagree with me, but to me, the point of IR is that it's a concretization, not an abstraction.
by mehrdadn 7y ago
> Otherwise why does the AST not qualify?
I'm sure someone will disagree with me, but to me, the point of IR is that it's a concretization, not an abstraction. Consider that your source code can look like
int foo(void);
or
class C;
or
template<class T> struct vector;
then you see that all of these translate into an AST, but don't result in any code getting generated. Conversely, given a template definition for vector, vector<int> and vector<string> would result in multiple intermediate representations for the exact same chunk of AST.
Calling the parsed representations of these "intermediate representations" when they're not corresponding to generated code would render the term practically useless. You might as well call the source code itself IR at that point and claim IR has no value.