Closed ghost closed 3 years ago
Hi, do you have any concrete examples?
Thanks
cjson_.ll.zip This is the [cjson project] IR file generated by wllvm and it is executable. For example , I want to slice for free function.
llvm-slicer -c free cjson_.ll
...
...
[llvm-slicer] Sliced away 586 from 3303 nodes in DG
[llvm-slicer] saving sliced module to: cjson_.ll.sliced
Then I llvm-dis the sliced file and compile it.
/usr/bin/ld: /tmp/cjson_-8c1b09.o: in function `cJSON_Duplicate':
llvm-link:(.text+0x3173): undefined reference to `cJSON_Delete'
clang: error: linker command failed with exit code 1 (use -v to see invocation)
when I slice for printf function
llvm-slicer -c printf cjson_.ll
...
[llvm-slicer] Sliced away 586 from 3303 nodes in DG
[llvm-slicer] saving sliced module to: cjson_.ll.sliced
I get the same result like above. And it is strange that llvm-slicer sliced away the same number(586) of nodes. I donot know why. Can you help me? Thanks.
Do the dg in devel-1118
branch works for you?
It works ! Thank you.
Hello, Sometimes the result of slicing is not an executable program. It removes the definitions of some functions and turns them into declarations, leaving only callsite. These functions are not slicing criterion. So I cannot compile this sliced bc file. The linker says that there is a undefined function. Is it a bug? How to deal with such a problem? Looking forward to your reply. Thanks!