dg
dg copied to clipboard
pta-show tool not working due to llvm-pta-dump incorrect dot syntax output
Either the llvm-pta-dump tool is being called with incorrect arguments in the pta-show script or there is an issue in llvm-pta-dump that leads to the output not being in the correct .dot syntax.
Examples:
$ cat _ps.dot | head
main:: %1 = alloca i32, align 4
-> main:: %1 = alloca i32, align 4
main:: %2 = alloca %struct.Node*, align 8
-> main:: %2 = alloca %struct.Node*, align 8
main:: %3 = alloca %struct.Node*, align 8
-> main:: %3 = alloca %struct.Node*, align 8
main:: %4 = alloca %struct.Node*, align 8
-> main:: %4 = alloca %struct.Node*, align 8
main:: %5 = alloca %struct.Node*, align 8
-> main:: %5 = alloca %struct.Node*, align 8
or
$ ./dgtool pta-show hello.c
INFO: Pointer analysis took 0 sec 2 ms
Error: _ps.dot: syntax error in line 1 near 'main'
[dgtool]: command return non-zero status
$ cat _ps.dot
main:: %1 = alloca i32, align 4
-> main:: %1 = alloca i32, align 4
Thanks for reporting it. This is indeed a bug. The behavior of llvm-pta-dump was changed when a generic API for pointer analyses was introduced. llvm-pta-dump now uses this API to show the points-to sets. Dumping to graphviz is a feature that dumps the internal representation of points-to analyses (the pointer graph) and therefore must be used together with -ir option.