diff --git a/cclyzer.sh b/cclyzer.sh index 18a9620..de03315 100755 --- a/cclyzer.sh +++ b/cclyzer.sh @@ -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:" @@ -14,6 +17,7 @@ usage() { 2-call-site-sensitive+heap" exit 1; } + while getopts "i:a::" o; do case "${o}" in i) @@ -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! @@ -41,7 +47,7 @@ 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 @@ -49,7 +55,9 @@ elif [ "$ANALYSIS" = "1-call-site-sensitive+heap" ]; then 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" diff --git a/src/logic/analysis.config b/src/logic/analysis.config new file mode 100644 index 0000000..e69de29 diff --git a/src/logic/master.project b/src/logic/master.project index 0f4cbfe..93878d4 100644 --- a/src/logic/master.project +++ b/src/logic/master.project @@ -1,3 +1,4 @@ +#include "analysis.config" #include "schema/schema.project" #include "import/import.project" #include "symbol-lookup/symbol-lookup.project" @@ -5,18 +6,12 @@ #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 \ No newline at end of file + #include "context/2-call-site-sens+heap/2-call-site-sens+heap.project" +#else + #include "context/insensitive/insensitive.project" +#endif