1818# build Build the project using make.
1919# rebuild Re-configure and build the project from scratch.
2020# run <file.ll> Run the pass on a specific LLVM IR file.
21+ # runS <file.ll> Run the pass on a specific LLVM IR file with -S output.
2122# test Run the lit test suite.
2223# pipeline [level] Print the optimization pipeline (default: -O0).
2324# inject <level> <file.ll> Inject/replace the custom pass in an optimization pipeline.
@@ -47,6 +48,7 @@ print_usage() {
4748 echo " build Build the project using make."
4849 echo " rebuild Re-configure and build the project from scratch."
4950 echo " run <file.ll> Run the pass on a specific LLVM IR file."
51+ echo " runS <file.ll> Run the pass on a specific LLVM IR file with -S output."
5052 echo " test Run the lit test suite."
5153 echo " pipeline [level] Print the optimization pipeline (default: -O0)."
5254 echo " inject <level> <file.ll> Inject/replace the custom pass in an optimization pipeline."
@@ -77,7 +79,7 @@ case $COMMAND in
7779 build)
7880 echo " --- Building project ---"
7981 cd ${BUILD_DIR}
80- make -j $( nproc )
82+ make
8183 ;;
8284
8385 rebuild)
@@ -102,6 +104,22 @@ case $COMMAND in
102104 ${INPUT_FILE}
103105 ;;
104106
107+ runS)
108+ if [ -z " $1 " ]; then
109+ echo " Error: Missing file argument for 'runS' command."
110+ print_usage
111+ exit 1
112+ fi
113+ INPUT_FILE=$1
114+ echo " --- Running pass on ${INPUT_FILE} with -S output ---"
115+ ${LLVM_DIR} /bin/opt \
116+ --load-pass-plugin ${BUILD_DIR} /lib/${PASS_LIB_NAME} \
117+ --passes=" ${PASS_NAME} " \
118+ -stats -debug \
119+ -S ${INPUT_FILE}
120+ ;;
121+
122+
105123 test)
106124 echo " --- Running lit tests ---"
107125 cd ${BUILD_DIR}
0 commit comments