Revert "tmp"
authoryu.dongliang <18588496441@163.com>
Wed, 8 Nov 2023 04:50:00 +0000 (12:50 +0800)
committeryu.dongliang <18588496441@163.com>
Wed, 8 Nov 2023 04:50:00 +0000 (12:50 +0800)
This reverts commit 5962f1d3dc67365f61732de80cf04281a1732ff8.

ses_layout.c

index 99f73c4c0f9a97ebf62667285bf142a1f1048b7e..54560323b7d946f8785fd0c23ce872817edb4475 100644 (file)
@@ -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);