Skip to content
Snippets Groups Projects
Commit 20e0876d authored by Daniel Maier's avatar Daniel Maier
Browse files

update perforate.sh

parent 719273df
No related branches found
No related tags found
No related merge requests found
#!/bin/sh
CLAN=/home/daniel/polyhedral_perforation/clan-0.8.0/clan
CLOOG=/home/daniel/polyhedral_perforation/pluto/cloog-isl/cloog
usage() {
printf "%s: <input_program> <output_program>\n" "$0"
}
if [ $# -ne 2 ]; then
usage
extract_scop() {
$CLAN "$1" > "$2"
}
perforate() {
if [ -e "$1.prepeforated" ]; then
cp "$1.prepeforated" "$2"
else
printf "perforation not possible, missing %s\n" "$1.prepeforated"
exit 1
fi
}
run_pluto() {
$PL
}
generate() {
$CLOOG -openscop "$1" > "$2"
}
output_src="-"
while true; do
case "$1" in
-h|--help)
usage
exit
;;
-a|--all)
cmd_extract=yes
cmd_perforate=yes
cmd_generate=yes
;;
-e|--extract)
cmd_extract=yes
;;
-p|--perforate)
cmd_perforate=yes
;;
-g|--generate)
cmd_generate=yes
;;
-o|--output)
shift
output_src="$1"
;;
*)
break
esac
shift
done
input_src=$1
scop="$input_src.openscop"
perforated="$input_src.perf.openscop"
if [ "$input_src" = "" ]; then
printf "missing input\n"
exit 1
fi
input="$1"
output="$2"
if [ "$cmd_extract" = "yes" ]; then
extract_scop "$input_src" "$scop"
fi
if [ "$cmd_perforate" = "yes" ]; then
perforate "$scop" "$perforated"
fi
if [ "$cmd_generate" = "yes" ]; then
generate "$perforated" "$output_src"
fi
printf "input is \"%s\" output is \"%s\"" "$input" "$output"
printf "input is \"%s\" output is \"%s\"\n" "$input_src" "$output_src"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment