From 93efbfe1c7941de23aae9496e3db9088ab896d2b Mon Sep 17 00:00:00 2001 From: Aditya Sharad Date: Thu, 17 Apr 2025 15:06:16 -0700 Subject: [PATCH] WIP: Go: Add context query for retrieving call graph edges --- go/ql/src/CallGraph.ql | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 go/ql/src/CallGraph.ql diff --git a/go/ql/src/CallGraph.ql b/go/ql/src/CallGraph.ql new file mode 100644 index 00000000000..dd0b3570704 --- /dev/null +++ b/go/ql/src/CallGraph.ql @@ -0,0 +1,15 @@ +/** + * @name Call graph + * @description Generates the call graph for the program. + * @kind graph + * @id go/call-graph + */ + +import go +import semmle.go.dataflow.DataFlow + +query predicate edges(CallExpr call, Function f, string key, string value) { + call.getTarget() = f and + key = "semmle.label" and + value = f.getQualifiedName() +}