From: yu.dongliang <18588496441@163.com> Date: Wed, 8 Nov 2023 04:50:00 +0000 (+0800) Subject: Revert "tmp" X-Git-Url: http://baseworks.info/?a=commitdiff_plain;h=a73fd96b54cf47f12f7abd669ed87e9469107481;p=ses.git Revert "tmp" This reverts commit 5962f1d3dc67365f61732de80cf04281a1732ff8. --- diff --git a/ses_layout.c b/ses_layout.c index 99f73c4..5456032 100644 --- a/ses_layout.c +++ b/ses_layout.c @@ -657,9 +657,11 @@ static void __ses_layout_path(ScfEfunction* f, ses_path_t* path, ses_path_t* bas { intptr_t i; - __ses_layout_path2(f, path, base); + if (path != base) { + __ses_layout_path2(f, path, base); - base = path; + base = path; + } if (base->childs) { for (i = 0; i < base->childs->size; i++) { @@ -722,13 +724,17 @@ static int __ses_layout_lines4(ScfEfunction* f) if (i >= paths->size) goto end; - p = base->pins->data[0]; - n = __ses_find_eline_index(f, p->lid); - SCF_XCHG(f->elines[n], f->elines[0]); + for (j = 0; j < base->pins->size; j += 2) { + p = base->pins->data[j]; + + n = __ses_find_eline_index(f, p->lid); + + SCF_XCHG(f->elines[n], f->elines[j / 2]); + } - p = base->pins->data[base->pins->size - 1]; + p = base->pins->data[j - 1]; n = __ses_find_eline_index(f, p->lid); - SCF_XCHG(f->elines[n], f->elines[f->n_elines - 1]); + SCF_XCHG(f->elines[n], f->elines[j / 2 + 1]); __ses_layout_path(f, base, base);