cil icon indicating copy to clipboard operation
cil copied to clipboard

Add printer that prints CILs internal AST representation

Open michael-schwarz opened this issue 4 years ago • 1 comments

This can be helpful for understanding how C code is represented by Cil.

michael-schwarz avatar Aug 27 '20 09:08 michael-schwarz

Hello. Please note that this AST printer is not yet complete. For example, at the moment, it fails for any expression that is not a PlusA or a Mult. I only wrote it to get a better understanding of how CIL models the following code, which contains a variably-modified type:

int main(void) {
  int n = 4;
  typedef int vla[n];
  n++;
  vla a;
  int i = sizeof(a);
}

keremc avatar Sep 14 '20 10:09 keremc