mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-12-15 04:31:49 +08:00
gas: xtensa: speed up find_trampoline_seg
find_trampoline_seg takes noticeable time when assembling source with many sections. Cache the result of the most recent search and check it first. No functional changes. gas/ 2017-11-27 Max Filippov <jcmvbkbc@gmail.com> * config/tc-xtensa.c (find_trampoline_seg): Add static variable that caches the result of the most recent search.
This commit is contained in:
parent
148d638429
commit
407e114084
@ -1,3 +1,8 @@
|
||||
2017-11-27 Max Filippov <jcmvbkbc@gmail.com>
|
||||
|
||||
* config/tc-xtensa.c (find_trampoline_seg): Add static variable
|
||||
that caches the result of the most recent search.
|
||||
|
||||
2017-11-27 Max Filippov <jcmvbkbc@gmail.com>
|
||||
|
||||
* config/tc-xtensa.c (trampoline_chain_entry, trampoline_chain)
|
||||
|
@ -7453,11 +7453,18 @@ static struct trampoline_seg *
|
||||
find_trampoline_seg (asection *seg)
|
||||
{
|
||||
struct trampoline_seg *ts = trampoline_seg_list.next;
|
||||
static struct trampoline_seg *mr;
|
||||
|
||||
if (mr && mr->seg == seg)
|
||||
return mr;
|
||||
|
||||
for ( ; ts; ts = ts->next)
|
||||
{
|
||||
if (ts->seg == seg)
|
||||
return ts;
|
||||
{
|
||||
mr = ts;
|
||||
return ts;
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user