GabrielDosReis / ipr

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

How to find out the owners of Regions? #251

Closed Xazax-hun closed 2 years ago

Xazax-hun commented 2 years ago

In https://github.com/GabrielDosReis/ipr/commit/59afd4298367bcd8a5ed0fd4efe1257ceb4a5f4d, Region::owner() was removed. We used this to check the context of the declarations. E.g., to check if a Var is a global, we traversed the parents of the enclosing Regions and checked what kind of regions do we encounter. E.g., if we encounter a the Region of a Block, we know this is not a global variable. With Region::owner() removed, we can no longer check what language construct do the parent regions of a Var correspond to.

Is there an alternative way to get this information that I'm missing? Or are we supposed to maintain a mapping independently of IPR on the side?