Problem Statement 1: Analyzing Cyclomatic Complexity
Analysis of the IR code generated by CLANG front-end is performed.
To trigger the functionality, copy the LLVM repo from https://github.com/llvm/llvm-project.
Checkout to Release/14.x
Then replace the llvm directory within the cloned git repo with the llvm repo present in this project.
To trigger functionality, type: clang <input_file.c> -mllvm -analyze-Cyclomatic
The cyclomatic functionality will be performed per function and output will be written to output.txt.
The exact code is located at llvm/lib/Analysis/CyclomaticComplexity.cpp
References: https://uditagarwal.in/writing-your-first-llvm-pass-and-registering-it-in-the-clang-toolchain/