MCPcopy Create free account
hub / github.com/FuzzAnything/PromptFuzz / find_callexprs

Method find_callexprs

src/ast/visitor.rs:253–268  ·  view source on GitHub ↗
(&self, call_name: &str)

Source from the content-addressed store, hash-verified

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(

Callers 2

is_read_from_fileFunction · 0.80

Calls 6

emptyMethod · 0.80
popMethod · 0.80
get_name_as_stringMethod · 0.80
push_childsMethod · 0.80
pushMethod · 0.45
get_childsMethod · 0.45

Tested by

no test coverage detected