Re: [PATCH 14/14] segment_report_module: Inline consider_phdr() into only caller

2020-11-12 Thread Timm Bäder via Elfutils-devel
On 12/11/2020 17:52, Navin P wrote: Hi, I already have a patch that makes elfutils compile with clang. Since you are working this will be of use to you. I've attached the patch since it is big. Here are some of the changes 1. All functions at file scope have static qualifier so that no col

[Bug libdw/22252] Parallel parsing of CU's DIEs from libdw

2020-11-12 Thread woodard at redhat dot com via Elfutils-devel
https://sourceware.org/bugzilla/show_bug.cgi?id=22252 Ben Woodard changed: What|Removed |Added Status|WAITING |RESOLVED Resolution|---

[PATCH 11/14] segment_report_module: Inline read_phdr() into only caller

2020-11-12 Thread Timm Bäder via Elfutils-devel
There is now only one caller for this nested function, so get rid of it by just inlining it there. Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 25 + 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.

[PATCH 03/14] segment_report_module: Remove nested finish() function

2020-11-12 Thread Timm Bäder via Elfutils-devel
This works just as well with a goto-out style label. Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 50 +--- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c

[PATCH 01/14] segment_report_module: Get rid of variable-length arrays

2020-11-12 Thread Timm Bäder via Elfutils-devel
This prevents a jump which is needed in a later patch. Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 36 ++-- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.

[PATCH 10/14] segment_report_module: Use one loop for p32/p64 arrays

2020-11-12 Thread Timm Bäder via Elfutils-devel
Do one loop check for 32/64 bit inside the loop, instead of outside. This way we have only one call site for the function called in the loop body. Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 52 +++- 1 file changed, 27 insertions(+), 25 deletions(

Removing gnu99 constructs from elfutils

2020-11-12 Thread Timm Bäder via Elfutils-devel
Hi, I'm looking into removing both the nested functions as well as variable-length arrays in the elfutils source code, so it can be built using clang. This is a continuation of https://sourceware.org/bugzilla/show_bug.cgi?id=24964 basically. I did try to incorporate some cleanup commits as well s

[PATCH 09/14] segment_report_module: Get rid of nested final_read() function

2020-11-12 Thread Timm Bäder via Elfutils-devel
Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 26 +++--- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 76686a72..80f97cfd 100644 --- a/libdwfl/dwfl_segme

[PATCH 12/14] segment_report_module: Unify d32/d64 loops

2020-11-12 Thread Timm Bäder via Elfutils-devel
Just like we did before, use only one loop here and check for 32/64 bit in the loop body. This way we only have one call site for consider_dyn Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 28 ++-- 1 file changed, 14 insertions(+), 14 deletions(-)

[PATCH 08/14] segment_report_module: Pull consider_notes() into file scope

2020-11-12 Thread Timm Bäder via Elfutils-devel
Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 187 +++ 1 file changed, 101 insertions(+), 86 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 44743fab..76686a72 100644 --- a/libdwfl/dwfl_se

[PATCH 04/14] segment_report_module: Remove nested release_buffer() function

2020-11-12 Thread Timm Bäder via Elfutils-devel
Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 16 ++-- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index d06d0ba0..ba11b60a 100644 --- a/libdwfl/dwfl_segment_report_m

[PATCH 13/14] segment_report_module: Inline consider_dyn() into only caller

2020-11-12 Thread Timm Bäder via Elfutils-devel
Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 40 +--- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 7c97784f..0679453e 100644 --- a/libdwfl/dwfl_seg

[PATCH 07/14] segment_report_module: Use a struct for build id information

2020-11-12 Thread Timm Bäder via Elfutils-devel
Keep the three build id fields in a struct. This will be an important clean up later. Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 54 1 file changed, 31 insertions(+), 23 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libd

[PATCH 05/14] segment_report_module: Pull finish_portion() info file scope

2020-11-12 Thread Timm Bäder via Elfutils-devel
Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 27 --- 1 file changed, 16 insertions(+), 11 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index ba11b60a..751a96f1 100644 --- a/libdwfl/dwfl_segm

[PATCH 14/14] segment_report_module: Inline consider_phdr() into only caller

2020-11-12 Thread Timm Bäder via Elfutils-devel
Get rid of the nested function this way Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 142 +-- 1 file changed, 66 insertions(+), 76 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 0679453

[PATCH 02/14] segment_report_module: Pull segment_read into file scope

2020-11-12 Thread Timm Bäder via Elfutils-devel
In preparation of getting rid of nested functions Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 30 +--- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c ind

[PATCH 06/14] segment_report_module: Pull read_portion() into file scope

2020-11-12 Thread Timm Bäder via Elfutils-devel
Signed-off-by: Timm Bäder --- libdwfl/dwfl_segment_report_module.c | 79 +--- 1 file changed, 48 insertions(+), 31 deletions(-) diff --git a/libdwfl/dwfl_segment_report_module.c b/libdwfl/dwfl_segment_report_module.c index 751a96f1..00455aa4 100644 --- a/libdwfl/dwfl_seg