Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 59 lines (47 sloc) 1.351 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
#!/bin/bash
if test -z "$1" || test ! -e "$1"; then
    echo Usage: $0 foo.c
    exit 1
fi

self="`readlink -f "$0"`"
topdir="`dirname "$self"`/.."

# basic setup
FA_BUILD="$topdir/fa_build"
FA_PLUG="$FA_BUILD/libfa.so"

# filled in by CMake
GCC=@GCC_HOST@

# initial checks
test -x "$GCC" || exit 1

# attempt to make
make -s $MAKEOPTS -C "$topdir/fa" || exit 1
test -x "$FA_PLUG" || exit 1

# use verbose level 0 by default
test -z "$FA_VERBOSE" && FA_VERBOSE=0

# use pp code listener by default
test -z "$FA_OPTS" && FA_OPTS="-fplugin-arg-libfa-dump-pp"

# use chromium as default SVG_VIEWER
test -z "$SVG_VIEWER" && SVG_VIEWER=chromium

if test x1 = "x$FA_PLOT"; then
    # wipe all .dot and .svg
    rm -f *.dot *.svg
fi

BOXDB=""
if [ "$2" != "" ]; then
    BOXDB="-fplugin-arg-libfa-args=db-root:$2"
fi

# run the gcc
valgrind --leak-check=full --trace-children=yes "$GCC" -c "$1" -o /dev/null -O0 -m32 \
    -DALIEN \
    -fplugin="$FA_PLUG" \
    -fplugin-arg-libfa-verbose="$FA_VERBOSE" \
    $BOXDB \
    $FA_OPTS \
    #|| exit $?

#if test x1 = "x$FA_PLOT"; then
    # visualize graphs
# printf "graph visualization in progress ... "
# make $MAKEOPTS -s -f "$topdir/sl/data/Makefile" TIMEOUT="timeout 2" \
# || exit $?
# printf "done\n"
# "$SVG_VIEWER" *.svg
#fi
Something went wrong with that request. Please try again.