Ada: Refactor assignments in constructor prologue.
The Ada compiler now uses a common routine for building component assignments in both constructor prologues and initialization procedures.
The Ada compiler now uses the same routine, Build_Component_Assignment, for constructing component assignments in both constructor prologues and initialization procedures. This change promotes code reuse and consistency. As a result, previous attempts to fix assignments of limited types in constructor prologues are no longer necessary.
In Details
This commit refactors the way component assignments are built in constructor prologues in the Ada compiler. The Build_Assignment logic is moved to Build_Component_Assignment in Exp_Util for more general use. The constructor prologue logic in exp_ch6.adb is then refactored to use Build_Component_Assignment. The affected files are exp_ch3.adb, exp_ch6.adb, exp_util.adb, exp_util.ads, and sem_ch5.adb.
For Context
In object-oriented programming, a constructor is a special method used to initialize a new object. A prologue is the code executed at the beginning of a constructor to set up the object's initial state. This commit refactors how the Ada compiler handles assignments within a constructor's prologue, making it more consistent with how assignments are handled in other initialization contexts. This improves the overall structure and maintainability of the compiler.