Skip to content

Commit

Permalink
Fix cclyzer.sh script
Browse files Browse the repository at this point in the history
  • Loading branch information
ktrianta committed Apr 23, 2021
1 parent bc6a648 commit d77070e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 14 deletions.
12 changes: 10 additions & 2 deletions cclyzer.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
#!/bin/bash

ANALYSIS_CONFIG="src/logic/analysis.config"

if [ -f "$ANALYSIS_CONFIG" ]; then
rm $ANALYSIS_CONFIG
fi

usage() {
echo "Usage: $0 PARAMETERS [OPTIONS]"
echo "PARAMETERS:"
Expand All @@ -14,6 +17,7 @@ usage() {
2-call-site-sensitive+heap"
exit 1;
}

while getopts "i:a::" o; do
case "${o}" in
i)
Expand All @@ -27,9 +31,11 @@ while getopts "i:a::" o; do
;;
esac
done

if ((OPTIND == 1)); then
usage
fi

shift $((OPTIND-1))
if [ ! -f "$INPUT_FILE" ]; then
echo Input file "$INPUT_FILE" not found!
Expand All @@ -41,15 +47,17 @@ mkdir facts
bin/fact-generator -o facts/ "$INPUT_FILE"
python3 cti.py facts/
mkdir -p results
touch "$ANALYSIS_CONFIG"

if [ "$ANALYSIS" = "context-insensitive" ]; then
echo "#define CONTEXT_INSENSITIVE" >> "$ANALYSIS_CONFIG"
elif [ "$ANALYSIS" = "1-call-site-sensitive+heap" ]; then
echo "#define ONE_CALL_SITE_SENSITIVE_HEAP" >> "$ANALYSIS_CONFIG"
elif [ "$ANALYSIS" = "2-call-site-sensitive+heap" ]; then
echo "#define TWO_CALL_SITE_SENSITIVE_HEAP" >> "$ANALYSIS_CONFIG"
else
echo "#define INSENSITIVE" >> "$ANALYSIS_CONFIG"
echo "#define CONTEXT_INSENSITIVE" >> "$ANALYSIS_CONFIG"
fi

souffle --profile=cclyzer.log -F facts/ -D results/ src/logic/master.project
rm "$ANALYSIS_CONFIG"
touch "$ANALYSIS_CONFIG"
Empty file added src/logic/analysis.config
Empty file.
19 changes: 7 additions & 12 deletions src/logic/master.project
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
#include "analysis.config"
#include "schema/schema.project"
#include "import/import.project"
#include "symbol-lookup/symbol-lookup.project"
#include "callgraph/callgraph.project"
#include "export/export.project"
#include "points-to/points-to.project"

#include "analysis.config"

#if defined(CONTEXT_INSENSITIVE)

#include "context/insensitive/insensitive.project"

#include "context/insensitive/insensitive.project"
#elif defined(ONE_CALL_SITE_SENSITIVE_HEAP)

#include "context/1-call-site-sens+heap/1-call-site-sens+heap.project"

#include "context/1-call-site-sens+heap/1-call-site-sens+heap.project"
#elif defined(TWO_CALL_SITE_SENSITIVE_HEAP)

#include "context/2-call-site-sens+heap/2-call-site-sens+heap.project"

#endif
#include "context/2-call-site-sens+heap/2-call-site-sens+heap.project"
#else
#include "context/insensitive/insensitive.project"
#endif

0 comments on commit d77070e

Please sign in to comment.