From 924cdc1c3149b6cb68b3b25f0e649cca36baba65 Mon Sep 17 00:00:00 2001 From: Michael Greenberg Date: Fri, 10 Apr 2026 22:15:40 -0400 Subject: [PATCH] Add FunObjVar::getSourceLoc binding --- pybind/SVFIR.cpp | 1 + pysvf/pysvf.pyi | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pybind/SVFIR.cpp b/pybind/SVFIR.cpp index f936a3f..6ef2b46 100644 --- a/pybind/SVFIR.cpp +++ b/pybind/SVFIR.cpp @@ -717,6 +717,7 @@ void bind_svf_var(py::module &m) { .def("getReturnType", &SVF::FunObjVar::getReturnType, py::return_value_policy::reference) .def("arg_size", &SVF::FunObjVar::arg_size) .def("getArg", &SVF::FunObjVar::getArg, py::arg("index"), py::return_value_policy::reference) + .def("getSourceLoc", &SVF::FunObjVar::getSourceLoc, py::return_value_policy::reference) .def("dominates", [](SVF::FunObjVar* node, SVF::SVFBasicBlock* bbKey, SVF::SVFBasicBlock* bbValue) -> bool { return node->dominate(bbKey, bbValue); diff --git a/pysvf/pysvf.pyi b/pysvf/pysvf.pyi index 8ae541a..a1447ad 100644 --- a/pysvf/pysvf.pyi +++ b/pysvf/pysvf.pyi @@ -1093,9 +1093,12 @@ class FunObjVar(BaseObjVar): def toString(self) -> str: ... """Get the string representation of the SVF variable""" + def getSourceLoc(self) -> str: ... + """Get the source location of the function definition""" + def dominates(self, bbKey: SVFBasicBlock, bbValue: SVFBasicBlock) -> bool: ... """Check if one basic block dominates another""" - + def postDominate(self, bbKey: SVFBasicBlock, bbValue: SVFBasicBlock) -> bool: ... """Check if one basic block post-dominates another"""