File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2828#include "gcc-c-api/gcc-declaration.h"
2929#include "gcc-c-api/gcc-diagnostics.h"
3030#include "gcc-c-api/gcc-option.h"
31+ #include "gcc-c-api/gcc-function.h"
3132
3233int plugin_is_GPL_compatible ;
3334
@@ -154,6 +155,12 @@ PyGcc_set_location(PyObject *self, PyObject *args)
154155 Py_RETURN_NONE ;
155156}
156157
158+ static PyObject *
159+ PyGcc_get_current_function (PyObject * self , PyObject * args )
160+ {
161+ return PyGccFunction_New (gcc_get_current_function ());
162+ }
163+
157164static bool add_option_to_list (gcc_option opt , void * user_data )
158165{
159166 PyObject * result = (PyObject * )user_data ;
@@ -458,6 +465,10 @@ static PyMethodDef GccMethods[] = {
458465 (PyCFunction )PyGcc_set_location ,
459466 METH_VARARGS ,
460467 ("Temporarily set the default location for error reports\n" )},
468+ {"get_current_function" ,
469+ (PyCFunction )PyGcc_get_current_function ,
470+ METH_VARARGS ,
471+ ("Get the current function declaration\n" )},
461472
462473 /* Options: */
463474 {"get_option_list" ,
You can’t perform that action at this time.
0 commit comments