(&self, call_name: &str)
| 251 | } |
| 252 | |
| 253 | pub fn find_callexprs(&self, call_name: &str) -> Vec<&Node> { |
| 254 | let mut worklist = WorkList::new(); |
| 255 | let mut calls = vec![]; |
| 256 | worklist.push(&self.ast); |
| 257 | while !worklist.empty() { |
| 258 | let curr = worklist.pop(); |
| 259 | if let Clang::CallExpr(ce) = &curr.kind { |
| 260 | let name = ce.get_name_as_string(curr); |
| 261 | if name == call_name { |
| 262 | calls.push(curr); |
| 263 | } |
| 264 | } |
| 265 | worklist.push_childs(curr.get_childs()); |
| 266 | } |
| 267 | calls |
| 268 | } |
| 269 | |
| 270 | /// get the code insert location before this call. |
| 271 | pub fn get_call_before_ins_loc( |
no test coverage detected