In #2656 there are comments about .debug_string() sometimes failing backend validations, making it turn up later, but currently necessary due to single transformations not being enough to validate in some cases. Also, that this per-backend validations can lead to code duplication.
We do have a mechanism to solve this, the validations should be implemented in each node's validate_global_constraints() which is called by the base visitor, so there is no code duplication, and potentially could be called (in addition) early for certain scenarios (e.g. after a self-contained meta-transformation).
These are then disabled for the DebugWriter, so I assume the validation that fails there is encoded inside the visitor itself. We should move these remaining checks to the respective validate_global_constraints()? Potentially the issue comes from:
Checks regarding symbols. Should we move them to a similar method in the symbol table? or to the scope. validate_global_constraints?
Fortran-only checks. Maybe they should all be in separate method in that backend that is also disabled when the backend is given check_global_constraints=False?
In #2656 there are comments about
.debug_string()
sometimes failing backend validations, making it turn up later, but currently necessary due to single transformations not being enough to validate in some cases. Also, that this per-backend validations can lead to code duplication.We do have a mechanism to solve this, the validations should be implemented in each node's
validate_global_constraints()
which is called by the base visitor, so there is no code duplication, and potentially could be called (in addition) early for certain scenarios (e.g. after a self-contained meta-transformation).These are then disabled for the DebugWriter, so I assume the validation that fails there is encoded inside the visitor itself. We should move these remaining checks to the respective validate_global_constraints()? Potentially the issue comes from:
scope. validate_global_constraints
?check_global_constraints=False
?