c++, contracts: Replace attribute lists with tree-vec for specifiers
Refactors C++ contract specifier handling to use tree-vec, simplifying code after CXX2A contract removal.
Following the removal of CXX2A contracts, the C++ front-end has refactored how function contract specifiers are handled. Previously, attribute lists were used to maintain compatibility, but now that these contracts are gone, the code has been simplified by replacing these lists with tree-vec. This change removes unnecessary obfuscation and streamlines the internal representation.
In Details
With the removal of CXX2A contracts, the contracts.cc and contracts.h files in gcc/cp have been updated to use tree-vec instead of attribute lists for storing function contract specifiers. This simplifies the internal representation, removing the need for CONTRACT_SOURCE_LOCATION_WRAPPER, CONTRACT_SOURCE_LOCATION, and CONTRACT_STATEMENT constructs, as well as associated functions like finish_contract_specifier. The change affects various parsing and tree substitution functions.
- CXX2A
- Refers to the C++20 standard, specifically features related to contracts that were part of the standard's development but later removed before finalization.
- tree-vec
- A data structure in GCC used to manage a vector of GCC internal tree nodes, offering dynamic resizing.
- Attribute List
- A data structure in GCC used to store attributes associated with a declaration or entity.