aboutsummaryrefslogtreecommitdiff
path: root/libcpp
diff options
context:
space:
mode:
authorJavier Martinez <javier.martinez.bugzilla@gmail.com>2023-08-23 15:02:40 +0200
committerJason Merrill <jason@redhat.com>2023-09-19 15:03:28 -0400
commit4f52e61e0665e760b95975b4d49437873967be2e (patch)
treed295e1e617ed5c9275f70a637703c30511c06aa9 /libcpp
parentb9912332c5b6fc9433ee11f5488acad117868888 (diff)
downloadgcc-4f52e61e0665e760b95975b4d49437873967be2e.zip
gcc-4f52e61e0665e760b95975b4d49437873967be2e.tar.gz
gcc-4f52e61e0665e760b95975b4d49437873967be2e.tar.bz2
c++: extend cold, hot attributes to classes
Most code is cold. This patch extends support for attribute ((cold)) to C++ Classes, Unions, and Structs (RECORD_TYPES and UNION_TYPES) to benefit from encapsulation - reducing the verbosity of using the attribute where deserved. The ((hot)) attribute is also extended for its semantic relation. gcc/c-family/ChangeLog: * c-attribs.cc (handle_hot_attribute): remove warning on RECORD_TYPE and UNION_TYPE when in c_dialect_xx. (handle_cold_attribute): Likewise. gcc/cp/ChangeLog: * class.cc (propagate_class_warmth_attribute): New function. (check_bases_and_members): propagate hot and cold attributes to all FUNCTION_DECL when the record is marked hot or cold. * cp-tree.h (maybe_propagate_warmth_attributes): New function. * decl2.cc (maybe_propagate_warmth_attributes): New function. * method.cc (lazily_declare_fn): propagate hot and cold attributes to lazily declared functions when the record is marked hot or cold. gcc/ChangeLog: * doc/extend.texi: Document attributes hot, cold on C++ types. gcc/testsuite/ChangeLog: * g++.dg/ext/attr-hotness.C: New test. Signed-off-by: Javier Martinez <javier.martinez.bugzilla@gmail.com> Reviewed-by: Jason Merrill <jason@redhat.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions