[cfe-dev] [StaticAnalyzer] What is the right callback for analyzing IfStmt ?

Mats Taraldsvik mats.taraldsvik at gmail.com
Sun Nov 3 04:02:12 PST 2013


Hi,

I am hoping to be able to develop (and contribute) a checker from the 
"potential future checkers" at clang-analyzer.llvm.org. Currently, I 
have created a checker and successfully registered it with the analyzer, 
but it currently does nothing.

I have looked at the "potential future checkers" list, and thought the 
different.IdenticalCondIfElseIf item could be an easy checker to 
implement for a beginner (If I'm wrong, perhaps you could point me 
towards a checker that is easy to implement).

However, I don't know what callback to use, since checkPreStmt and 
checkPostStmt does not include control flow statements, and the 
checkBranchCondition only checks each branch condition.

I would need to examine the entire if-branch (if condition x every else 
if condition), to be able to detect identical branch conditions, right?

Regards,
Mats Taraldsvik



More information about the cfe-dev mailing list