aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.cc
diff options
context:
space:
mode:
authorPiotr Trojanek <trojanek@adacore.com>2022-10-06 23:42:46 +0200
committerMarc Poulhiès <poulhies@adacore.com>2022-11-04 14:47:25 +0100
commit533d79ac93b7757060a901df055575320e2ca422 (patch)
tree130b0b5a349fa4239af7c719ff4c2913337e57d4 /gcc/expr.cc
parent41d5a493ede13740a30b4a66cc666ac4daa92fb7 (diff)
downloadgcc-533d79ac93b7757060a901df055575320e2ca422.zip
gcc-533d79ac93b7757060a901df055575320e2ca422.tar.gz
gcc-533d79ac93b7757060a901df055575320e2ca422.tar.bz2
ada: Improve efficiency of scope stack restoration
We save/restore visibility by setting the Is_Immediately_Visible flag and appending entities to / removing them from the tail of an element list. However, the Is_Immediately_Visible flag can be restored in any order, while the element list is singly-linked and removal from the tail is inefficient. This change removes a performance hot spot, which accounted for up to 10% of compilation time of complex applications (e.g. QGen), at least as measured on GNAT built with profiling support. gcc/ada/ * sem_ch8.adb (Restore_Scope_Stack): Remove elements from the head and not the tail of an element list.
Diffstat (limited to 'gcc/expr.cc')
0 files changed, 0 insertions, 0 deletions