diffkemp icon indicating copy to clipboard operation
diffkemp copied to clipboard

Viewer - add visualisation of macros and macro-function diffs

Open PLukas2018 opened this issue 1 year ago • 0 comments

This PR adds visualisations of macros to the result viewer.

It was necessary to get information about definitions of macros. I did not use cscope because there can be multiple macros with the same name, I took advantage of the fact that the call stack for macros does not contain a line from where it is called at the macro but the line where the macro starts (btw. I am not sure that this is expected behaviour, I think that it probably should be also a line from which is called the macro as it is for functions). For the last macro in the call stack, the information about the definition is extracted from Simpll and passed down to DiffKemp and the result viewer.

Also, this PR extends the function, for getting a line where function/type ends, for getting it also for macros.

Because the macros can appear only on one side/version of the call stack, it was necessary to edit components of the viewer and copy also new source files to viewer dir (subdir new-src), the dir for the old source files is renamed to old-src.

This PR also extends the viewer for visualisation of macro-function/function-macro differences. To make this possible information about the SyntaxDifference kind (macro, macro-function, function-macro, assembly) is added and necessary information about definitions are extracted from LLVM IR (there is a case when the information is not possible to be extracted if the LLVM IR contains information only about declaration of the function and not about its definition).

I compared 8.0, 8.1, 8.2, 8.3 and 8.4 versions of RHEL/CentOS to check I did not break the comparison. And I went over some differences in the viewer.

Screenshots of the visualisation:

Macro code image Macro which is only located in the old call stack image Macro which is only located in the new call stack image Macro code image Macro difference image Macro-function difference image

PLukas2018 avatar Dec 26 '23 21:12 PLukas2018