We wish to design an analysis that can check that close is only called if the file is currently open, that open is only called if the file is currently closed, and that the file is definitely closed at the program exit.
In this homework, you are expected to implement a pass to perform an intraprocedural path-sensitive property checking(i.e. file state) for a C program.
We assume that
You can generate the bc code by the following command or use the bc code provided in the benchmark section.
clang -O0 -g -emit-llvm example.c -c -o example.bc (This command applies the existing optimization in LLVM on the final IR so that it may look slightly different from the original program.)The output of the example.cc is as follows. You should output the file name, final state, and its paths at exit point of program.