aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-uninit.c
diff options
context:
space:
mode:
authorTim Adye <Tim.Adye@cern.ch>2021-06-04 15:59:38 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-06-04 15:59:38 +0100
commitf6bb145c0bff19767931d37733be11c8acc6fa00 (patch)
tree369f46cbe40b2b8c2ee3bc73467bcebb07570723 /gcc/tree-ssa-uninit.c
parentf78f25f43864f38ae5a6a9fcce8f26c94fe45bcd (diff)
downloadgcc-f6bb145c0bff19767931d37733be11c8acc6fa00.zip
gcc-f6bb145c0bff19767931d37733be11c8acc6fa00.tar.gz
gcc-f6bb145c0bff19767931d37733be11c8acc6fa00.tar.bz2
libstdc++: Optimize std::any_cast by replacing indirect call
This significantly improves the performance of std::any_cast, by avoiding an indirect call to the _S_manage function through a function pointer. Before we make that indirect call we've already established that the contained value has the expected type, which means we also know the manager type, and so can call one of its members directly. We also know the precise type in the any::emplace functions, because we've just constructed that type, so we can use the new member there too. That doesn't seem to affect performance, but we might as well use the new _S_access function anyway. Signed-off-by: Tim Adye <Tim.Adye@cern.ch> Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: * include/std/any (any::_Manager::_S_access): New static function to access the contained value. (any::emplace, __any_caster): Use _S_access member of the manager type.
Diffstat (limited to 'gcc/tree-ssa-uninit.c')
0 files changed, 0 insertions, 0 deletions