Add Has_Side_Effect function for place holders
pjljvandelaar opened this issue · 1 comments
pjljvandelaar commented
We need a function to determine whether a place holder (which points to an expression)
has a side effect.
We can start with a simple version that
states that a function call always has a side effect,
reading constants and variable has not side effect,
and operators have a side effect when one of there arguments has a side effect.
pjljvandelaar commented
Closed by
15bdc08
Note: some improvements are still possible
- Analyze whether function call indeed has side effect
- (in-)out parameters
- write to non-local variable
- write to file / screen / ...
- Handling Attribute_Ref
- see e.g. https://en.wikibooks.org/wiki/Ada_Programming/Attributes/%27Pos that an attribute is a function.
- Can one implement it own 'Image function in Ada 2022?