0

I have included the following code in llvm/tools/clang/include/clang/StaticAnalyzer/Checkers/Checkers.td file under

let ParentPackage = CoreAlpha in{ 
... 
def SimpleFunc: Checker<"SimpleFunc">, 
  HelpText<"Simple Function Checking">, 
  DescFile<"SimpleFunc.cpp">; 

But when I am checking its presence after successful compilation by typing the following command, the checker is not visible.

clang -cc1 -analyzer-checker-help 

I don't know what's the reason, hope someone could help me regarding this.

pavikirthi
  • 1,569
  • 3
  • 17
  • 26

1 Answers1

0

I can't say much without looking at source file,but I can think of two possibilities. First, you might be missing something like

void ento::registerSimpleFunc(CheckerManager &mgr) {
    mgr.registerChecker<SimpleFunc>();
}

in the SimpleFunc.cpp as this is what will register the checker.

Secondly, you might have forgotten to add SimpleFunc.cpp in the CMakeLists.txt so that SimpleFunc.cpp gets compiled and registered.

Nishant Sharma
  • 683
  • 9
  • 16
  • 1
    Thanks for the reply.I now got to know what was the problem.Actually I have two versions of clang - one installed with respect to Ubuntu and the other one installed along with llvm, so since I made changes with respect to llvm-clang I had to run clang from build/bin/clang. – pavikirthi Jun 15 '16 at 02:16
  • oh yeah, that's a tricky one. On a personal note, I will recommend using just one version of clang. It adds unnecessary complexities (like this one) and sometimes it becomes hard to debug them just because one was debugging the other version. – Nishant Sharma Jun 15 '16 at 04:05