GabrielDosReis / ipr

Compiler-neutral Internal Program Representation for C++
BSD 3-Clause "New" or "Revised" License
221 stars 23 forks source link

How to work with For? #253

Closed Xazax-hun closed 2 years ago

Xazax-hun commented 2 years ago

In C++, all parts of For are optional, but in IPR, the getter methods of For always wants to return something. If we do not fill one of the fields we will get an assertion fail. Previously, we used the Empty_stmt to always fill those fields. But https://github.com/GabrielDosReis/ipr/commit/bd6467e200a405eb9942a7bf1f6a1cda970a8f99 removed it. How should IPR represent a for statement with missing components?