visit all the callexpr that are library calls.
(&self)
| 172 | |
| 173 | /// visit all the callexpr that are library calls. |
| 174 | pub fn visit_library_calls(&self) -> Vec<&Node> { |
| 175 | let mut calls = Vec::new(); |
| 176 | let mut worklist = WorkList::new(); |
| 177 | worklist.push(&self.ast); |
| 178 | while !worklist.empty() { |
| 179 | let curr = worklist.pop(); |
| 180 | if let Clang::CallExpr(ce) = &curr.kind { |
| 181 | let name = ce.get_name_as_string(curr); |
| 182 | if get_func_gadget(&name).is_some() { |
| 183 | calls.push(curr); |
| 184 | } |
| 185 | } |
| 186 | worklist.push_childs(curr.get_childs()); |
| 187 | } |
| 188 | calls |
| 189 | } |
| 190 | |
| 191 | pub fn get_library_call_names(&self) -> Vec<String> { |
| 192 | let mut calls = Vec::new(); |
no test coverage detected