[cfe-dev] Best way to determine which condition branch i am on in a static analyzer checker

Richard tarka.t.otter at googlemail.com
Wed Dec 12 08:06:30 PST 2012


hey there

i am writing a static analyzer checker that needs to know if it is contained in a surrounding IfStmt, and if the current node is on the true or false branch. what is the simplest way to achieve this? 

currently i am using the previous nodes ParentMap and walking back up through parents until i find an IfStmt, but i am unsure how i can tell if this node belongs to the If or an Else / Else If branch. any pointers?

ta





More information about the cfe-dev mailing list