Skip to content

Commit

Permalink
ps-show,rd-show,llvmdg-dump: use xdot when available
Browse files Browse the repository at this point in the history
nice viewer

Signed-off-by: Marek Chalupa <mchqwerty@gmail.com>
  • Loading branch information
mchalupa committed May 23, 2016
1 parent 7d80009 commit 2fed0d3
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 9 deletions.
20 changes: 17 additions & 3 deletions tools/llvmdg-show
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,26 @@ DIR=`dirname $0`

#defult program
GUI=xdg-open
DIRECTDOT=0

if which okular &>/dev/null; then
set -e

if which xdot &>/dev/null; then
GUI=xdot
DIRECTDOT=1
elif which okular &>/dev/null; then
GUI=okular
elif which evince &>/dev/null; then
GUI=evince
fi

$DIR/llvm-dg-dump $* > ldg-show-output.dot && dot -Tpdf ldg-show-output.dot -o ldg-show-output.pdf && $GUI ldg-show-output.pdf
rm ldg-show-output*
$DIR/llvm-dg-dump $* > _ldg-show-output.dot

if [ $DIRECTDOT -eq 1 ]; then
$GUI _ldg-show-output.dot
else
dot -Tpdf _ldg-show-output.dot -o ldg-show-output.pdf
$GUI _ldg-show-output.pdf
fi

rm _ldg-show-output*
22 changes: 19 additions & 3 deletions tools/ps-show
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,28 @@

#defult program
GUI=xdg-open
DIRECTDOT=0

if which okular &>/dev/null; then
# exit on any error
set -e

if which xdot &>/dev/null; then
GUI=xdot
DIRECTDOT=1
elif which okular &>/dev/null; then
GUI=okular
elif which evince &>/dev/null; then
GUI=evince
fi

`dirname $0`/llvm-ps-dump -dot $@ > _ps.dot && dot -Tpdf -o _ps.pdf _ps.dot && $GUI _ps.pdf
rm _ps.pdf _ps.dot
`dirname $0`/llvm-ps-dump -dot $@ > _ps.dot


if [ $DIRECTDOT -eq 1 ]; then
$GUI _ps.dot
rm _ps.dot
else
dot -Tpdf -o _ps.pdf _ps.dot
$GUI _ps.pdf
rm _ps.pdf _ps.dot
fi
20 changes: 17 additions & 3 deletions tools/rd-show
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

#defult program
GUI=xdg-open
DIRECTDOT=0

if which okular &>/dev/null; then
set -e

if which xdot &>/dev/null; then
GUI=xdot
DIRECTDOT=1
elif which okular &>/dev/null; then
GUI=okular
elif which evince &>/dev/null; then
GUI=evince
fi

`dirname $0`/llvm-rd-dump -dot $@ > _rd.dot && dot -Tpdf -o _rd.pdf _rd.dot && $GUI _rd.pdf
rm _rd.pdf _rd.dot
`dirname $0`/llvm-rd-dump -dot $@ > _rd.dot

if [ $DIRECTDOT -eq 1 ]; then
$GUI _rd.dot
rm _rd.dot
else
dot -Tpdf -o _rd.pdf _rd.dot
$GUI _rd.pdf
rm _rd.pdf _rd.dot
fi

0 comments on commit 2fed0d3

Please sign in to comment.