Closed TimHe95 closed 2 years ago
llvm-to-source
cannot do something like that. It can work only with a single C file. It's just a very simple debugging tool (patches are welcome ;). You may try to compile the code with -g -fno-discard-value-names
and use llvm2c or rellic to get C code from the sliced LLVM. The code will not look like the original code, but it will be C...
Works well! Thanks.
I want to slice a part of the PostgreSQL source, from
fsync
function, backward to an entry:RecordTransactionCommit
. This anaylsis contains tree.c
source files:xact.c
xlog.c
fd.c
. Following the document, I obtain the.bc
files repectively:And link them together:
Then, run the slicer.
I want to know what code (i.e., for me, variable names) remains after slicing. So I use
llvm-to-source
The resulting code is in a mess. It contains some random comments. It seems that
llvm-to-source
does not distinguish the line numbers of the three files. How can I solve this problem?Thanks!