Are you using the latest ‘n’ greatest clang? If so, you may add options to your checker by first declaring it in Checkers.td, here’s an example:
def MyExample : Checker<“MyChecker”>,
CmdLineOption<Boolean, // type of the option: String, Boolean, Integer
“Option1”, // name
“example description 1”, // description
“true”, // default value
Released, // development stage: InAlpha, Released
, // whether it should be hidden, e.g. it’s an implementation detail
“example description 2”,
, // note that this option isn’t hidden
Then, you may invoke the analyzer with the new options as you normally would:
clang -cc1 -analyze -analyzer-checker=MyExample -analyzer-config MyExample:Option1=false
clang --analyze -Xclang -analyzer-checker=MyExample -Xclang -analyzer-config -Xclang MyExample:Option1=false
Please follow up if you’re still having trouble!
Hello, I’m beginner in CSA programming. I have read clang SA a checker developer manual
and have some questions.
How can I pass command line options to CSA checker? Does -Xanalyzer option can help me?
May be I need to see AnalyzerOptions.cpp, but can’t understand how to catch options from my checker.
Also I want to know is it possible to realize multi-pass analyzer with parallel or sequential running of one or multiply checker with data transfer between passes.
I need to run first checker that taint some input, observes taint values and find some AST expressions (or with path sensible analysis).
After this checker ends up I need to start the second checker, that uses search results of 1’st in analysis from begining of ExplodedGraph.
Are you sure that you need two sequential passes? As far as I know, we have nothing like that currently.