(&mut self, stmt: &ast::Node)
| 107 | } |
| 108 | |
| 109 | fn visit_stmt(&mut self, stmt: &ast::Node) -> Result<()> { |
| 110 | let stmt = stmt.ignore_cast().ignore_parent(); |
| 111 | log::trace!("visit stmt: {:?}", stmt.kind); |
| 112 | match stmt.kind { |
| 113 | // This kinds of stmts only act as a dummy to declear the stmt kind, we skip evaluate these stmts. |
| 114 | ast::Clang::TranslationUnitDecl |
| 115 | | ast::Clang::CompoundStmt(_) |
| 116 | | ast::Clang::ReturnStmt(_) |
| 117 | | ast::Clang::Other |
| 118 | | ast::Clang::BreakStmt |
| 119 | | ast::Clang::ContinueStmt |
| 120 | | ast::Clang::CXXMemberCallExpr |
| 121 | | ast::Clang::LabelStmt(_) |
| 122 | | ast::Clang::GotoStmt(_) |
| 123 | | ast::Clang::FunctionDecl(_) |
| 124 | | ast::Clang::DeclRefExpr(_) |
| 125 | | ast::Clang::IntegerLiteral(_) |
| 126 | | ast::Clang::StringLiteral(_) |
| 127 | | ast::Clang::CharacterLiteral(_) |
| 128 | | ast::Clang::FloatingLiteral(_) |
| 129 | | ast::Clang::CXXNullPtrLiteralExpr(_) |
| 130 | | ast::Clang::MemberExpr(_) |
| 131 | | ast::Clang::GNUNullExpr(_) => self.visit_dummy_stmt(stmt), |
| 132 | ast::Clang::DeclStmt(_) => self.visit_decl_stmt(stmt), |
| 133 | ast::Clang::ParmVarDecl(_) | ast::Clang::VarDecl(_) => self.visit_var_decl(stmt), |
| 134 | ast::Clang::BinaryOperator(_) => self.visit_binary_operator(stmt), |
| 135 | ast::Clang::CallExpr(_) => self.visit_call_expr(stmt), |
| 136 | ast::Clang::UnaryOperator(_) |
| 137 | | ast::Clang::ImplicitCastExpr(_) |
| 138 | | ast::Clang::CStyleCastExpr(_) |
| 139 | | ast::Clang::CXXReinterpretCastExpr |
| 140 | | ast::Clang::ParenExpr(_) => { |
| 141 | for child in stmt.get_childs() { |
| 142 | self.visit_stmt(child)?; |
| 143 | } |
| 144 | Ok(()) |
| 145 | } |
| 146 | _ => { |
| 147 | //log::warn!("stmt {stmt:?} is unimplemented in DFA"); |
| 148 | self.visit_dummy_stmt(stmt) |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | /// This kinds of stmts only act as a dummy to declear the stmt kind, we skip evaluate these stmts. |
| 154 | fn visit_dummy_stmt(&self, _stmt: &ast::Node) -> Result<()> { |
no test coverage detected