Final project of compiler course based on LLVM. You can find the report here
mkdir build
cd build
cmake ..
make
cd src
./gsm "<the input you want to be compiled>" > gsm.ll
llc --filetype=obj -o=gsm.o gsm.ll
clang -o gsmbin gsm.o ../../rtGSM.c
int a;
int a = 3;
int a, b = 4, 5;
int c, d = 6;
c = a * b;
int a, b = 5, 3;
if a > b: begin
a -= 1;
end
elif a < b: begin
a -= 2;
end
else: begin
a -= 3;
end
int a = 7;
loopc a > 0: begin
a -= 1;
end
int a, b = 5 ^ 3;
/* a *= 2; This line is commented out and doesn't affect the procedure
b += 5 */
a -= 1;
int a = 2 * 4;
print a % 2;